Skip to content

dtinth/redux-send

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-send

Read the introduction here: Functions as Redux actions

Demo App: https://dtinth.github.io/redux-send/

sendMiddleware :: ReduxStoreMiddleware

A Redux middleware that wraps message functions that are dispatched to the store in { type: 'SEND_MESSAGE', message: message }.

createReducer :: Model → ReduxReducer

Creates a Redux reducer which forwards the message to the model.

Typeclass

Model<ModelState>

A Model is an Object with these keys:

  • getInitialState :: () → ModelState
  • All other keys are methods that take any arbitrary argument returns a ModelUpdater<ModelState>

ModelState

A ModelState is any JavaScript object that holds the state of your application.

ModelUpdater<ModelState> :: ModelState → ModelState

A ModelUpdater is a function that takes a model state and returns the next state.

Dispatching Functions

You can dispatch a function of type (Model → ModelUpdater), then redux-send will update the state according to the returned updater.

About

An alternative way to write Redux apps. (Experimental.)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published