|
14 | 14 | * [fx](#module_fx) |
15 | 15 | * [.exports.Console(...args)](#module_fx.exports.Console) |
16 | 16 | * [.exports.Debounce(props)](#module_fx.exports.Debounce) |
| 17 | + * [.exports.Dispatch(action)](#module_fx.exports.Dispatch) |
17 | 18 | * [.exports.HistoryPush(props)](#module_fx.exports.HistoryPush) |
18 | 19 | * [.exports.HistoryReplace(props)](#module_fx.exports.HistoryReplace) |
19 | 20 | * [.exports.Http(props)](#module_fx.exports.Http) |
@@ -79,6 +80,27 @@ const DebouncedAction = state => [ |
79 | 80 | }) |
80 | 81 | ] |
81 | 82 | ``` |
| 83 | +<a name="module_fx.exports.Dispatch"></a> |
| 84 | + |
| 85 | +### fx.exports.Dispatch(action) |
| 86 | +Describes an effect that will dispatch whatever action is passed to it. Useful for batching actions and FX together. |
| 87 | + |
| 88 | +**Kind**: static method of [<code>fx</code>](#module_fx) |
| 89 | + |
| 90 | +| Param | Type | Description | |
| 91 | +| --- | --- | --- | |
| 92 | +| action | <code>\*</code> | an action to dispatch | |
| 93 | + |
| 94 | +**Example** |
| 95 | +```js |
| 96 | +import { Dispatch } from "hyperapp-fx" |
| 97 | + |
| 98 | +const BatchedFxAndActions = state => [ |
| 99 | + state, |
| 100 | + SomeFx, |
| 101 | + Dispatch(SomeAction) |
| 102 | +] |
| 103 | +``` |
82 | 104 | <a name="module_fx.exports.HistoryPush"></a> |
83 | 105 |
|
84 | 106 | ### fx.exports.HistoryPush(props) |
@@ -173,6 +195,8 @@ const Login = state => [ |
173 | 195 | <a name="module_fx.exports.Merge"></a> |
174 | 196 |
|
175 | 197 | ### fx.exports.Merge(action) |
| 198 | +Describes an effect that will shallow-merge the results from actions that return partial state. |
| 199 | + |
176 | 200 | **Kind**: static method of [<code>fx</code>](#module_fx) |
177 | 201 |
|
178 | 202 | | Param | Type | Description | |
|
0 commit comments