Railway Service
Implementation of railway oriented programming in javascript. Long story short what it does is executes all defined steps if there is no error. Otherwise it will stop executing steps right after failed step.
Usage
- Create a service (for example RocketService)
const rocketService = ;
- Add a step
- Each step must return either {error: ...} or {params: ...}
rocketService;
- Steps get params from previous step
rocketService;
- Finally run the service
const res = rocketService;
- It will return boolean succeeded property or error if occurred
For more information about Railway Oriented Programming please refer to http://www.slideshare.net/ScottWlaschin/railway-oriented-programming