rt2zz / redux-action-buffer

Buffer Redux Actions
MIT License
79 stars 6 forks source link

add parameter for indicating an array of actions not to buffer #15

Closed brownbl1 closed 7 years ago

brownbl1 commented 7 years ago

I think this should address issue #14. I also added a very similar test to show what my changes would do.

Also, would this really constitute a breaking change if we only are adding an additional parameter? The first test passed without any modifications so in that sense it wouldn't effect current consumers.

Just let me know what you think!

rt2zz commented 7 years ago

i.e.

module.exports = function bufferActions(options, cb) {
  var active = true
  var queue = []
  var passthrough = options && options.passthrough || []

  var breaker = typeof options === 'object'
    ? options.breaker
    : options

  var breakerType = typeof breaker
  //...
}

Kind of messy but it should work. That or we can just make a breaking change and release a new major version.

brownbl1 commented 7 years ago

Yeah, I like that better too. I'll clean it up in the morning.

brownbl1 commented 7 years ago

Changes made, and I also updated the readme to reflect the new argument definition. Feel free to tweak it. Tests still pass so I think we're good?

brownbl1 commented 7 years ago

Awesome! Thanks. Also, I realized I forgot to bump the minor version in package.json. Could you do that and push a new package to npm when you get a chance?