Creates a new signal scope. When there is already an active signal scope then this already active scope is considered to be a parent scope and the new scope is registered in it as child scope so it is destroyed when the parent scope is destroyed.
Note that creating a signal scope does not activate it. You have to do this yourself, it can be done it one line: scope = new SignalScope().activate()
.
Static
registerRegisters the given destroyable object in the current signal scope if present.
The destroyable object to register.
A signal scope which can be used by frameworks to automatically destroy registered destroyable signals when the scope is destroyed. A UI framework for example can create a signal scope for a UI component, set it as active scope and then initialize the component calling the component constructor which might create signals which must be destroyed when component is destroyed. When the framework wants to destroy the component it can destroy the signal scope to automatically destroy any signals created while this scope was active.