More docs massaging.

This commit is contained in:
Mike Thompson 2016-08-25 00:41:56 +10:00
parent b391c03a3e
commit 2049731bbd
2 changed files with 23 additions and 15 deletions

View File

@ -1,9 +1,3 @@
## Structuring Your Application:
1. [Basic App Structure](Basic-App-Structure.md)
2. [Navigation](Navigation.md)
3. [Namespaced Keywords](Namespaced-Keywords.md)
## Understanding Event Handlers:
@ -12,3 +6,15 @@
3. [Effects](Effects.md)
4. [CoEffects](coeffects.md)
## Structuring Your Application:
1. [Basic App Structure](Basic-App-Structure.md)
2. [Navigation](Navigation.md)
3. [Namespaced Keywords](Namespaced-Keywords.md)
## Tutorials
1. [Talking To Servers](Talking-To-Servers.md)

View File

@ -97,19 +97,22 @@ There'd also need to be a handler for the `:bad-response` event too. Left as an
This approach will work, and it is useful to take time to understand why it
would work, but it has a problem: the event handler isn't pure.
That `GET` is a side effect, and side effecting functions are like a
well salted paper cut. We try very hard to avoid them.
well salted paper cut. We try hard to avoid them.
### Version 2
The solution is, of course, to use an effectful handler. This is discussed in detail
in the previous tutorials: [Effectful Handlers](EffectfulHandler.md) and [Effects](Effects.md].
The better solution is, of course, to use an effectful handler. This
is explained in detail in the previous tutorials: [Effectful Handlers](EffectfulHandler.md)
and [Effects](Effects.md].
We use the alternative registration function, `reg-event-fx` , and we use an
effect handler from [https://github.com/Day8/re-frame-http-fx](https://github.com/Day8/re-frame-http-fx)
You may be tempted to write your own.
We use the alternative registration function, `reg-event-fx` , and we'll use an
"Effect Handler" supplied this this library
[https://github.com/Day8/re-frame-http-fx](https://github.com/Day8/re-frame-http-fx).
You may soon feel confident enough to write your own.
We'll want . Like this:
Here's our rewrite:
```clj
(ns my.app.events
(:require
@ -133,4 +136,3 @@ Notes:
1. Our event handler to "describe" a side effect, rather than to "do" the side effect
2. The event handler for `:process-response` stays as it was.