asr-active-state-watcher
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -20,5 +20,9 @@ 'use strict'; | ||
var state = _ref2.state; | ||
var domApi = _ref2.domApi; | ||
if (!currentDomApis[state.name]) { | ||
console.error('detaching, but no current dom api for that name was found'); | ||
} | ||
currentDetachListeners.forEach(function (fn) { | ||
return fn(currentDomApis[state.name]); | ||
return fn(domApi); | ||
}); | ||
@@ -25,0 +29,0 @@ delete currentDomApis[state.name]; |
@@ -11,4 +11,7 @@ module.exports = function magicalDomThingy(stateRouter) { | ||
function detachFromState({ state }) { | ||
currentDetachListeners.forEach(fn => fn(currentDomApis[state.name])) | ||
function detachFromState({ state, domApi }) { | ||
if (!currentDomApis[state.name]) { | ||
console.error('detaching, but no current dom api for that name was found') | ||
} | ||
currentDetachListeners.forEach(fn => fn(domApi)) | ||
delete currentDomApis[state.name] | ||
@@ -15,0 +18,0 @@ } |
{ | ||
"name": "asr-active-state-watcher", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Waches an abstract-state-router and calls your function with all active DOM APIs", | ||
@@ -5,0 +5,0 @@ "main": "es5.js", |
4988
91