Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
esrol-initializer
Advanced tools
An Initializer Class used for adding and initializing components. Priority must exist between them.
An Initializer Class used for adding and initializing components. Priority must exist between them.
Part of Esrol
$ npm install --save esrol-initializer
'use strict';
let Initializer = require('../lib/initializer');
let initializer = new Initializer();
let foo = {
priority: 1,
component: function() {
console.log('foo component is resolved');
}
};
let promise = new Promise((resolve, reject) => {
// some async stuff
setTimeout(() => {
resolve();
}, 500);
});
promise.then(() => {
console.log('promisified component is resolved');
});
let promisifiedComponent = {
priority: 2,
component: function() {
console.log('promisified component is instantiated');
return promise;
}
};
let bar = {
priority: 3,
component: function() {
console.log('bar component is resolved');
}
};
let onResolvedComponents = function() {
console.log('all components are resolved');
};
initializer.setCallback(onResolvedComponents);
initializer.registerComponent(promisifiedComponent);
initializer.registerComponent(foo);
initializer.registerComponent(bar);
initializer.instantiateComponents();
boolean
Set a callback which will be called when all components are resolved.
boolean
Register a new component object. Re-sort (re-prioritize) components with the new one.
Instantiate all components.
boolean
Set a callback which will be called when all components are
resolved.
Returns: boolean
- true - on success
Throws:
error
error - if parameter is not a functionParam | Type | Description |
---|---|---|
fn | function | the callback function that needs to be executed when all components are resolved |
boolean
Register a new component object. Re-sort (re-prioritize) components with the new one.
Returns: boolean
- true - on success
Throws:
error
error - if component object isn't as expectedParam | Type | Description |
---|---|---|
component | object | holds two properties - { priority: 1, component: function() {} } |
Instantiate all components.
Any contribution will be highly appreciated. Just make sure that:
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
FAQs
An Initializer Class used for adding and initializing components. Priority must exist between them.
The npm package esrol-initializer receives a total of 9 weekly downloads. As such, esrol-initializer popularity was classified as not popular.
We found that esrol-initializer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.