palmetto flow - nodebotschs/nodebotsday-editor GitHub Wiki

Palmetto-Flow is a simple abstraction on top of pub/sub systems to make it very simple to organize the loose separation of our modules without a lot of boilier plate.

var palmetto = require('palmettoflow-nodejs')
var ee = palmetto()

// service
ee.on('/foo/bar', function (e) {
   // do something of value
  ee.emit('send', response(e, { 'hello': 'world' })
})

// factory

module.exports = function action (value, dispatch) {
  var ne = newEvent('foo', 'bar', { 'change': 'state'})
  ee.on(ne.from, function (e) {
    // dispatch response to single store
    dispatch('action', e.object)
  })
  ee.emit('send', ne)
}

For more info - https://github.com/twilson63/palmettoflow