/fluxury-redux

UNMAINTAINED!

Primary LanguageJavaScriptMIT LicenseMIT

fluxury-redux

Circle CI

Quick Start

npm install --save fluxury fluxury-redux
import { createReducer, createStore } from 'fluxury-redux'

Summary

Redux-compatible reducer and compose stores into larger objects; built on Fluxury.

Also, see the React-Fluxury library.

With Redux

var createReduxStore = require('redux').createStore
var createReducer = require('fluxury-redux').createReducer
var MessageStore = require('./MessageStore')
var MessageCountStore = requrie('./MessageCountStore')

// will reduce to array with an item for each store
var store = createReduxStore( createReducer(MessageStore, MessageCountStore) )

Without Redux

Combine multiple stores into a single store. Interface compatible with Redux.

import { createStore } from 'fluxury-redux'
import MessageStore from './MessageStore'
import MessageCountStore from './MessageCountStore'

// will reduce to an object where the stores for messages and count are
// composed into a larger object with the same shape as the input.
//
// Only supports 1 level. Not recursive.
var store = createStore({
  messages: MessageStore,
  count: MessageCountStore
})