Skip to content

Commit

Permalink
don't wrap cancel action in cid creator (#1)
Browse files Browse the repository at this point in the history
fixes cancellation

relevant: root-systems/feathers-action#18
  • Loading branch information
ahdinosaur authored Jul 26, 2017
1 parent bf2db96 commit 291b1f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 291b1f9

Please sign in to comment.