Comparing version 3.0.1 to 3.0.2
25
dot.js
@@ -9,3 +9,2 @@ /*global Map Promise Set*/ | ||
fnType = "function", | ||
objType = "object", | ||
period = ".", | ||
@@ -29,3 +28,3 @@ propRegex = /[^.]+/g, | ||
dot.onAny = setup.bind({ fn: on, m: "anyMap", s: s }) | ||
dot.reset = reset.bind({ state: s }) | ||
dot.reset = reset.bind({ s: s }) | ||
dot.state = s | ||
@@ -46,3 +45,3 @@ | ||
var ps = keys.map(function(prop, i) { | ||
var promise = keys.map(function(prop, i) { | ||
props = props + (i > 0 ? period : empty) + prop | ||
@@ -52,3 +51,6 @@ return callOn(a, m, props) | ||
return Promise.all([callOn(a, m, ""), Promise.all(ps)]) | ||
return Promise.all([ | ||
callOn(a, m, ""), | ||
Promise.all(promise), | ||
]) | ||
} | ||
@@ -163,3 +165,3 @@ | ||
return off.bind(null, fn, m, null, p, r, s) | ||
return off.bind(null, fn, m, o, p, r, s) | ||
} | ||
@@ -170,4 +172,4 @@ | ||
function reset() { | ||
this.state.anyMap = new Map() | ||
this.state.onMap = new Map() | ||
this.s.anyMap = new Map() | ||
this.s.onMap = new Map() | ||
} | ||
@@ -187,5 +189,8 @@ | ||
fn = t === fnType ? opt : fn | ||
p = t === strType ? (p ? p + period + opt : opt) : p | ||
o = t === objType && opt ? opt : o | ||
var isFn = t === fnType, | ||
isStr = t === strType | ||
fn = isFn ? opt : fn | ||
p = isStr ? (p ? p + period + opt : opt) : p | ||
o = !isFn && !isStr ? opt : o | ||
} | ||
@@ -192,0 +197,0 @@ |
{ | ||
"name": "dot-event", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Powerful event emitter", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
8145
277