feat(redux) throw exception in case invalid listeners are registered
This allows catching mistakes early.
This commit is contained in:
parent
b22915c169
commit
8127ea2479
|
@ -136,6 +136,10 @@ class StateListenerRegistry {
|
|||
* @returns {void}
|
||||
*/
|
||||
register(selector: Selector, listener: Listener, options?: RegistrationOptions) {
|
||||
if (typeof selector !== 'function' || typeof listener !== 'function') {
|
||||
throw new Error('Invalid selector or listener!');
|
||||
}
|
||||
|
||||
this._selectorListeners.add({
|
||||
listener,
|
||||
selector,
|
||||
|
|
Loading…
Reference in New Issue