-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Currently, Einigeln is fully synchronous. This could be changed with some additional API parameters.
Example:
di.set('foo', function(container, resolve) {
// Not returning any value here, so Einigeln will assume resolve will be called when ready.
setTimeout(function() {
resolve(new Foo(container.get('bar')));
}, 1000);
});The additional API Call:
di.getAsync('foo').then(console.log);For such a feature, get() needs to realize when a service used returnand when it using resolve.
So kind of a Map with a flag for each service if it is async needs to be added. Depending on that flag either get or getAsync will access each other on behalf.
Reactions are currently unavailable