react-starter-kit icon indicating copy to clipboard operation
react-starter-kit copied to clipboard

field name of action type is different in location.js

Open lehneres opened this issue 11 years ago • 6 comments

in most cases

Dispatcher.dispatch( {
            actionType: ActionTypes.ACTION,
            somepayload
        } );

is used. In location,.js

Dispatcher.dispatch( {
            type: ActionTypes.CHANGE_LOCATION,
            somepayload
        } );

is used. I think this could be simplified to actionType such that every dispatch recieves the same pattern.

PS: I'm sorry that I can not create a PR by myself at the moment

lehneres avatar Aug 17 '15 21:08 lehneres

Actually you can also create FooTypes.ACTION_FOO or BazTypes.FOO_BAZ It's not limited to ActionTypes, indeed, it just an example

nodegin avatar Aug 17 '15 23:08 nodegin

well this issue is not about the ActionTypes.FOO, of course... Its about the naming of the arguments given to the dispatcher. And yes, of course, you could name the anyway you want, but for consistency, I would suggest to keep them uniform...

lehneres avatar Aug 18 '15 07:08 lehneres

@lehneres I'm not sure I understand, how are you suggesting to pass arguments to the dispatcher?

koistya avatar Aug 18 '15 07:08 koistya

no ;) Its not a big issue at all. I just stumbled over the naming of the actionType field in the dispatch payload, which is actionType in most places and type in the Location.js

lehneres avatar Aug 18 '15 08:08 lehneres

@lehneres I can't find any actionType occurrences:

https://github.com/kriasoft/react-starter-kit/search?utf8=%E2%9C%93&q=actionType

koistya avatar Aug 18 '15 08:08 koistya

oh. really? Than I did introduce this discrepancy by myself... sorry for the disturbance....

lehneres avatar Aug 18 '15 08:08 lehneres