You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: The more correct name for this function is probably createActionCreator(), but that seems a bit redundant.
In my opinion this is not redundant. This is important. It creates confusion and it takes me extra time to clear out the unnecessary confusion when talking to redux to somebody new to it (Yes, not everybody that join a project has allocated time to just study redux).
The confusion I'm talking about is:
an action is an object
an action creator is a function
So when they go an see that createAction returns a function, they think that the function is the action and end up wrapping it up in another function, making a mess.
My point is, let's just have an alias (so that it's backward compatible) so that whoever wants can use createActionCreator instead of createAction. Also I'd love not have to hack this into my project.
The text was updated successfully, but these errors were encountered:
christopher-francisco
changed the title
can we have an alias function that is called createActionCreator()?
Can we have an alias function that is called createActionCreator()?
Jan 17, 2019
@dorian-marchal this workaround works, in a technical sense. However, think about a newbie ramping up to the project and see that all of the redux js files have has createAction aliased as createActionCreator, they ask "why?"
Then you have to go ahead and explain the problem with the current name, why is it confusing, and why we chose to go with an alias.... sounds more confusing to me.
Docs says about the
createAction
function:In my opinion this is not redundant. This is important. It creates confusion and it takes me extra time to clear out the unnecessary confusion when talking to redux to somebody new to it (Yes, not everybody that join a project has allocated time to just study redux).
The confusion I'm talking about is:
action
is anobject
action creator
is afunction
So when they go an see that
createAction
returns a function, they think that the function is the action and end up wrapping it up in another function, making a mess.My point is, let's just have an alias (so that it's backward compatible) so that whoever wants can use
createActionCreator
instead ofcreateAction
. Also I'd love not have to hack this into my project.The text was updated successfully, but these errors were encountered: