danscan / rn-redux-mixpanel

Configurable redux middleware that sends your actions & user profile data to Mixpanel. Works with React Native!
67 stars 14 forks source link

Support accessing state in ignoreAction function #16

Open bertiecroll opened 6 years ago

bertiecroll commented 6 years ago

Hi,

I have a requirement to conditionally ignore actions based on state associated to a user. Currently the ignoreAction function only has action as an argument, are we able to move the call to store.getState() before the ignoreAction check and passing in the state as a second argument? Something like below

    const state = store.getState()
    if (!action.type || ignoreAction(action, state)) {
      return next(action)
    }

Thanks very much!