Skip to content

v0.3.0

Latest
Compare
Choose a tag to compare
@zalmoxisus zalmoxisus released this 10 Nov 10:16
· 1 commit to master since this release

sendOnCondition

function (state, action) - when returns true (the condition is satisfied), the report will be sent. Unlike sendOn, here you can check not only the action type, but the whole action object and also the state object. Another difference is that by default the report will be sent only first time the condition is satisfied. If you want to send it multiple times, set options.sentOnCondition to false in beforeSending function.

Example:

createStore(reducer, remotedev({
  sendTo: 'http://localhost:8000',
  sendOnCondition: (action, state) => state.counter.count === 5,
  // sendOnCondition: (action, state) => state.user.id !== undefined,
  // sendOnCondition: (action, state) => action.user.id !== undefined,
  // sendOnCondition: (action, state) => action.type === 'SOME_ACTION'
}))

Misc

  • Exposed store to sendingStatus functions (#1).
  • Added 'same-origin' credentials to add cookies to the request (#2).
  • Renamed error key with exception.
  • Added instanceId parameter to identify the store in case there are multiple stores.