question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action Type Namespace

See original GitHub issue

Currently 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:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
amaurymcommented, Aug 22, 2017

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.

0reactions
eddyystopcommented, Aug 23, 2017

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 .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found