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

Prefix action strings to namespace them. #843

Merged
merged 6 commits into from
Jul 2, 2016
Merged

Prefix action strings to namespace them. #843

merged 6 commits into from
Jul 2, 2016

Commits on Jun 21, 2016

  1. Update Actions.js

    prefixed action strings with 'router_' to namespace them.
    
    I noticed the action constants are very generic strings (not namespaced like 'router_jump' etc.):
    ```
    export const JUMP_ACTION = 'jump';
    export const PUSH_ACTION = 'push';
    export const REPLACE_ACTION = 'replace';
    export const POP_ACTION2 = 'back';
    export const POP_ACTION = 'BackAction';
    export const REFRESH_ACTION = 'refresh';
    export const RESET_ACTION = 'reset';
    export const FOCUS_ACTION = 'focus';
    ```
    As I understand Redux, all actions get passed to all reducers when you use `combineReducers`. We see these strings as being so generic that it opens a very real risk of me (or another module I did not read) dispatching an action that evaluates to the same string, triggering an action that was not supposed to be triggered. To prevent this I propose the following change, or any other that diminishes this risk.
    ThaJay committed Jun 21, 2016
    Configuration menu
    Copy the full SHA
    8132c99 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from ThaJay/ThaJay-patch-1

    Prefix actions in Actions.js for namespacing
    ThaJay committed Jun 21, 2016
    Configuration menu
    Copy the full SHA
    05c9c0c View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2016

  1. Configuration menu
    Copy the full SHA
    5eff817 View commit details
    Browse the repository at this point in the history
  2. action strings in Reducer.test.js

    DJ committed Jun 22, 2016
    Configuration menu
    Copy the full SHA
    0afc60e View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2016

  1. Configuration menu
    Copy the full SHA
    7e24b4d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fc40bad View commit details
    Browse the repository at this point in the history