yarn redux-logger 2.1.1

latest releases: 4.0.0, 3.0.6, 3.0.5...
8 years ago

Changelog

  • deprecated: transformer is deprecated, use stateTransformer instead
  • feature: colors object

Colors

We have so much requests (#91, #94 and other) about control over messages, so we bring it to life 🎉
Logger now have colors: Object option with 3 keys: prevState, action, nextState, each must return color as string (for example, red or #03A9F4).

  • prevState(prevState: Object) => color: String
  • action(action: Object) => color: String
  • nextState(nextState: Object) => color: String

colors also can be false if you don't need paint message or your env doesn't support console formatting (#92).

Examples

Disable colors

const logger = createLogger({
  colors: false
});

Paint action message with type AUTH_TOKEN_REMOVE to red

const logger = createLogger({
  colors: {
    prevState: () => `#9E9E9E`,
    action: (action) => action.type === `AUTH_REMOVE_TOKEN` && `red`,
    nextState: () => `#4CAF50`,
  }
});

Don't miss a new redux-logger release

NewReleases is sending notifications on new releases.