You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
Singletons should also be allowed to be instances when it's fitting. Maybe perhaps determined by initializer. For example a Storage adapter may be a singleton for a specific connection/directory, but another singleton for a different directory. This essentially groups flows into singletons deterministically.
The text was updated successfully, but these errors were encountered:
I suppose we could leave these up to the blueprint implementations themselves. A top level singleton can choose to create a new instance of itself based on some factor.
Example implementation:
Blueprint = {
instances: {},
init: function(props, callback) {
if (instances[props.path])
return instances[props.path]
// Set up a new instance to be shared here.
}
}
Singletons should also be allowed to be instances when it's fitting. Maybe perhaps determined by initializer. For example a Storage adapter may be a singleton for a specific connection/directory, but another singleton for a different directory. This essentially groups flows into singletons deterministically.
The text was updated successfully, but these errors were encountered: