Comparing version 6.0.1 to 6.0.2
27
index.js
@@ -65,4 +65,7 @@ // const debug = require('debug')('barracks') | ||
if (fn.length === 2) return fn(data, retFn) | ||
fn(data) | ||
end() | ||
else { | ||
fn(data) | ||
stack.pop() | ||
done() | ||
} | ||
@@ -74,2 +77,3 @@ // execute `wait()` and `done()` | ||
function retFn (action, cb) { | ||
cb = cb || function () {} | ||
if (action) return wait(action, endWrap) | ||
@@ -79,14 +83,7 @@ endWrap() | ||
function endWrap () { | ||
if (cb) cb() | ||
end() | ||
cb() | ||
stack.pop() | ||
done() | ||
} | ||
} | ||
// pop name from stack | ||
// and exit series call | ||
// null -> null | ||
function end () { | ||
stack.pop() | ||
done() | ||
} | ||
} | ||
@@ -99,6 +96,8 @@ } | ||
function emitErr (err) { | ||
const emitter = actions.error ? actions.error[0] : function () {} | ||
emitter(err) | ||
if (!actions.error) { | ||
throw new Error("unhandled 'error' event") | ||
} | ||
actions.error[0](err) | ||
} | ||
} | ||
} |
{ | ||
"name": "barracks", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Action dispatcher for unidirectional data flows", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ # barracks | ||
dispatcher.on('upsert', (data, wait) => { | ||
const index = store.indexOf(data.prevName) | ||
const index = store.indexOf(data.newName) | ||
if (index !== -1) return wait('insert') | ||
@@ -71,8 +71,8 @@ store[index] = data.newName | ||
### I want to start using barracks, but I'm not sure how to use it | ||
### I want to use barracks, but I'm not sure where to start | ||
That's fine, that means this readme needs to be improved. Would you mind | ||
opening an [issue](https://github.com/yoshuawuyts/barracks/issues) and explain | ||
what you don't understand? I want `barracks` to be comprehensive for | ||
developers of any skill level, so don't hesitate to ask questions if you're | ||
unsure about something. | ||
what you don't understand? I want `barracks` to be comprehensive for developers | ||
of any skill level, so don't hesitate to ask questions if you're unsure about | ||
something. | ||
@@ -79,0 +79,0 @@ ### Why didn't you include feature X? |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8720