Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for action type transforming #33

Closed
wants to merge 1 commit into from

Conversation

arusakov
Copy link

Hi, thank a lot for great logger!

Option for action type transforming will be helpful, if action type is a number (for example, member of some enum). In this case for pretty logging you can provide typeToString function like this:

const enum = {
  1: 'action_one',
  2: 'action_two',
  action_one: 1,
  action_two: 2
};

import createLogger from 'redux-logger';
const logger = createLogger({
  typeToString: (type) => enum[type]
});

// ...
// and somewhere in app
dispatch({type: enum.action_one});

@imevro
Copy link
Collaborator

imevro commented Sep 24, 2015

Hi, thanks for idea. Will release in 1.1.0 tomorrow!

@imevro imevro closed this Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants