redux-pouch-pull
This is a rewrite of pouch-redux-middleware to only support one-way pull syncing.
Install
$ npm install redux-pouch-pull --save
Use
Example of configuring a store:
{ const db = 'todos' const middleware = const store = return store}
API
PouchMiddleware(paths)
paths
: path or array containing path specs
A path spec is an object describing the behaviour of a sub-tree of the state it has the following attributes:
db
: a PouchDB databaseactions
: an object describing the actions to perform when a change in the Po. It's an object containing a function that returns an action for each of the events (remove
,insert
andupdate
)changeFilter
: a function that receives a changed document, and if it returns false, the document will be ignored for the path. This is useful when you have multiple paths in a single database that are differentiated through an attribute (liketype
).
Example of a path spec:
db actions: { return type: typesDELETE_TODO id: doc_id } { return type: typesINSERT_TODO todo: doc } { return type: typesUPDATE_TODO todo: doc }
License
ISC