docstate
0.0.2 • Public • Published Docstate, for stately Couch stuff
A very basic state manager for document based state machines.
Usage
Here is how you would create a useless infinite loop, all serialized through a CouchDB changes feed.
var control = require('docstate').control();
control.safe("user", "new", function(doc){
console.log(doc.type)
doc.state = "old";
})
control.safe("user", "old", function(doc){
doc.state = "new";
})
control.start()
mythicalChangesListener.onChange(function(info, doc){
control.handle(doc)
})
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads