Promisify Barracks
What is barracks?
From https://github.com/yoshuawuyts/barracks:
Action dispatcher for unidirectional data flows. Creates tiny models of data that can be accessed with actions through a small API.
This plugin makes subscriptions
and effects
work with promises. It
also wraps send
inside subscriptions
and effects
to return a
promise which is resolved when it has completely finished. Basically
done
is called automatically when the promise is resolved or rejected.
Usage
const promisifyPlugin = const barracks = { return } const store = storestoreconst createSend = storestartconst send = promisifyPlugin
Tests
I'm using blue-tape
to write simple tests.
See test.js
and try out npm t
License
MIT → See LICENSE
file.