From 1691f9bc696a4b5ca17a560723a022097bdfd036 Mon Sep 17 00:00:00 2001 From: Michael Williams Date: Mon, 15 May 2017 14:49:53 +1200 Subject: [PATCH] don't wrap cancel action in cid creator fixes cancellation relevant: https://github.com/ahdinosaur/feathers-action/pull/18 --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 09b2695..0deb359 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ import { Component, createElement } from 'react' import { connect as connectRedux } from 'react-redux' import { bindActionCreators as bindDispatchActionCreators } from 'redux' import createCid from 'incremental-id' -import { is, pipe, compose, merge, map, partialRight } from 'ramda' +import { is, pipe, compose, merge, map, mapObjIndexed, partialRight } from 'ramda' const { isArray } = Array const isFunction = is(Function) @@ -17,7 +17,10 @@ export function connect (options) { return compose(reduxConnector, feathersConnector) } -const bindCidToActionCreators = map(action => { +const bindCidToActionCreators = mapObjIndexed((action, name) => { + // don't bind cid to complete action + if (name === 'complete') return action + return (...args) => { const cid = createCid() action(cid, ...args)