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.

`prefix` option for `createActions`

See original GitHub issue

As I know there are a lot of folks writing something like this following ducks proposal:

const prefix = 'some-feature';

const { [prefix]: actionCreators } = createActions(
  {
    [prefix]: {
      SOME_ACTION: payloadCreator,
    },
  }, 
  `${prefix}/PLAIN_ACTION`,
);

This looks kinda hacky. Can we consider adding prefix in options for createActions to handle this common case?

const actionCreators = createActions(
  {
    SOME_ACTION: payloadCreator,
  },
  'PLAIN_ACTION',
  {
    prefix: 'some-feature',
  },
);

Will create pull request if this will be helpful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
udalrichcommented, May 9, 2018

Is this documented anywhere other than this issue?

2reactions
mslippercommented, Mar 7, 2018

Merged and released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

createAction(s) - redux-actions
You can prefix each action type by passing a configuration object as the last argument of createActions . ... 'INCREMENT' in this example...
Read more >
Grant permission to tag resources during creation
To enable users to tag resources on creation, they must have permissions to use the action that creates the resource, such as ec2:RunInstances...
Read more >
Run Github action when pull request origin branch has certain ...
I am trying to create actions which behave differently depending on the prefix of the ... I've tried setting a script up like...
Read more >
How to use the redux-actions.createAction function in ... - Snyk
createAction examples, based on popular ways it is used in public projects. ... type = createActionType(prefix, stage, separator) return createAction(type, ...
Read more >
Create a custom process action - Power Apps | Microsoft Learn
After you create the action, you can't change the prefix. ... Unlike workflow processes, you don't need to set the following options:.
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