statecontainer

2.0.0 • Public • Published

Simple object state container.

Example

const stateContainer = require('statecontainer');
const connections = stateContainer.store('connections');
 
const connectionUrl = 'amqp://localhost:9000';
const connection = connections.cachedResult(connectionUrl, getConnector(connectionUrl));
 
function getConnector(connectionUrl) {
    return async() => {
        return await amqp.connect(connectionUrl);
    }
} 

API

Readme

Keywords

none

Package Sidebar

Install

npm i statecontainer

Weekly Downloads

4

Version

2.0.0

License

MIT

Last publish

Collaborators

  • dsdenes