lab-statecontainer

1.2.0 • Public • Published

What is it?

Collection of state related handler functions with namespacing.

Example

const stateContainer = require('lab-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);
    }
} 

Readme

Keywords

none

Package Sidebar

Install

npm i lab-statecontainer

Weekly Downloads

1

Version

1.2.0

License

MIT

Last publish

Collaborators

  • dsdenes