Comparing version 1.0.2 to 1.0.3
@@ -162,2 +162,5 @@ 'use strict'; | ||
}, | ||
replaceState: function replaceState(state) { | ||
currentState = state; | ||
}, | ||
getState: function getState(cb) { | ||
@@ -164,0 +167,0 @@ return currentState; |
{ | ||
"name": "fluxury", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Add luxury sugar to simplify implementing Facebook's flavor of Flux architecture.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -17,14 +17,12 @@ # fluxury | ||
This library adds 2 functions to Facebook's flux implementation to guide you into the `(state, action) -> state` pattern. This library forks Flux 2.0.2. | ||
This library forks Flux 2.0.2; pushing you into the `(state, action) -> state` pattern. | ||
This library is similar to Reflux and Redux except that this library doesn't try to eliminate the dispatcher concept. | ||
This Flux fork focuses around 2 functions: | ||
This Flux flavor adds a surface area of 2 new functions: | ||
- dispatch(action) or dispatch(type, data) | ||
- createStore(name, actionHandler, selectors) or createStore(name, defaultValue, actionHandler, selectors) | ||
You may see that this is compatible with Redux. Please see [Fluxury-Redux](https://github.com/FunctionFoundry/fluxury-redux) for integration. | ||
Of course it is compatible with React. Please see [React-Fluxury](https://github.com/FunctionFoundry/react-fluxury) for more information. | ||
Enjoy! | ||
It is compatible with Redux. Please see [Fluxury-Redux](https://github.com/FunctionFoundry/fluxury-redux) for integration. | ||
@@ -35,3 +33,3 @@ ## API Reference | ||
Submit an action into the stores. You must specify the type and, optionally, some data. | ||
Submit an action into the stores. | ||
@@ -51,3 +49,3 @@ ```js | ||
Create a new store with a name, initialState, reducer function and an object with methods that maybe used to operate state. | ||
Creating a store is to Flux what creating a class is to React. | ||
@@ -97,2 +95,3 @@ ```js | ||
| getState | A function that returns the current state | | ||
| replaceState | Replace the state; use with caution | | ||
@@ -99,0 +98,0 @@ ## Put it all together |
@@ -151,2 +151,5 @@ /* fluxury - Copyright 2015 Peter Moresi */ | ||
}, | ||
replaceState: function(state) { | ||
currentState = state; | ||
}, | ||
getState: function(cb) { | ||
@@ -153,0 +156,0 @@ return currentState; |
51310
1086
194