code-harmony
Make your code more readable by making the functions work in harmony with each other.
- Provides an interface to write code in a more granular format.
- Allows the sharing of resources between various worker functions to reduce duplicate data fetching or generating.
Install
npm install code-harmony
Usage
// this is an example of a context creating function// can be any asynchronous call which// resolves with an object containing data// the data is then populated in the context object// which is available to the worker functions { const user = await ; return Promise;} // this is an example of a worker function { console // -> { userId: 1234 } return Promise;} const CodeHarmony = ; subscribedData // resolves when all the tasks finishes ; // action can be taken on any error here