Action Type Namespace
See original GitHub issueCurrently all of the action types are named SERVICE_NAME + ACTION
, it would be great if you can specify a namespace to adhere to Ducks.
Or even better would it be possible to pass a function to create the action type, like a formatter.
Example:
(name, action) => `app-namespace/${name}/${action}`;
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
how to implement action type namespacing ? · Issue #786 ...
Lets say you have a module "Geometry", with ActionType of "Area". This module is used in two places: AppA->Drawing->Geometry (namespace="Drawing ...
Read more >Namespace Redux Action Types - Jake Trent
Redux actions represent the important things that your app can do. "Important" might consist of things that need to be saved or things...
Read more >Action Delegate in C# - TutorialsTeacher
Action is a delegate type defined in the System namespace. An Action type delegate is the same as Func delegate, except that the...
Read more >Action<T> Delegate (System) - Microsoft Learn
Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.
Read more >How do I set a type of "any interface" in a given namespace?
I am using Redux with TypeScript for the first time and would like to assign types to my actions, then bind those action...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I actually agree with @Sicria.
What if, unlikely as it may seem, that my own app has an action named
SERVICES_MESSAGES_FIND
, whose reducer is doing something radically different than what feathers-redux does. There might be confusion when feathers-redux dispatches its action.I wouldn’t go as far as adding a formatter (too overkill), but renaming all actions to something like
feathersjs/services/MESSAGES_FIND
,feathersjs/services/MESSAGES_FIND_PENDING
etc would be an idea to prevent confusion. Plus it’s following the Ducks naming convention.Really, it’s just changing this line.
It looks like this repo is reaching some level of maturity and the needs are changing.
Perhaps either of you can submit a PR as I’m tied up. The optional namespace can be passed in the
option
. Please take this pending PR into account https://github.com/feathersjs/feathers-redux/pull/29 .