You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
*A tiny lib (12 lines) for creating state machines as swappable Redux reducers*
5
+
*A tiny lib (16 lines) for creating state machines as swappable Redux reducers*
6
+
7
+
>This is the version of this library to use when your Redux store state is an[Immutable JS](https://facebook.github.io/immutable-js/)[Map](https://facebook.github.io/immutable-js/docs/#/Map). See also the[non-immutable-js version of redux-machine](https://github.com/mheiber/redux-machine).
6
8
7
9
redux-machine enables you to create[reducers](http://redux.js.org/docs/basics/Reducers.html) that can transition between different "statuses." These are likes states in a[finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine). The goal is for redux-machine to support complex workflows simply while keeping all state in the redux store. Keeping all state in the store is good because:
8
10
@@ -38,10 +40,9 @@ The reducer returned by `createMachine` will act like `initReducer` when its sta
The (marginal) advantages of using redux-machine over just using the FSM pattern is that you can more clearly express intent and write slightly less code.
98
100
99
-
##Asynchronous Effects
100
-
101
-
redux-machine doesn't prescribe a way of handling asynchronous effects such as API calls. This leaves it open for you to use[no async effects library](http://stackoverflow.com/a/34599594/2482570),[redux-loop](https://github.com/redux-loop/redux-loop),[redux-thunk](https://github.com/gaearon/redux-thunk),[redux-saga](https://github.com/yelouafi/redux-saga), or anything else.
102
-
103
-
That said, redux-machine fits very naturally with other tools which enhance the expressiveness of reducers, such as redux-loop and redux-side-effect. Here's how you could use redux-machine with redux-loop: