Skip to content

wmakeev/scaleflow

Repository files navigation

ScaleFlow

npm Travis Coveralls Gemnasium JavaScript Style Guide

ScaleFlow is simple framework based on Stamp Specification and Redux like data flow

Install

$ npm install scaleflow

Usage

const { Core } = require('scaleflow')

const loggerInitializer = (options, { instance }) => {
  return Object.assign(instance, {
    log: (...args) => instance.dispatch({
      type: 'LOG',
      payload: [`${options.name || 'LOG'}:`].concat(args)
    })
  })
}

const loggerMiddleware = core => next => action => {
  if (action.type === 'LOG') {
    console.log(...action.payload)
  }
  return next(action)
}

let MyCore = Core
  .init(loggerInitializer)
  .middleware(loggerMiddleware)

let myCore = MyCore({ name: 'MyCore' })

myCore.log('Hello world!') // MyCore: Hello world!

API

TODO

License

MIT © Viatliy V. Makeev

About

Tools and convention to create scaleable apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published