
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
actions-creator
Advanced tools
actions-creator is an awesome javascript package that allows you to dynamically create action objects in Redux without having to declare constants and separate action-creator functions for each action.
You can find the full documentation on the website
actions-creator is an awesome javascript package that allows you to dynamically create action objects in Redux without having to declare CONSTANTS and separate action-creator functions for each action.
npm install actions-creator
import {actionsCreator} from 'actions-creator'
const action_1 = actionsCreator.MY.FIRST.ACTION('arg1')
// {
// type: 'MY/FIRST/ACTION',
// payload: 'arg1',
// }
const action_2 = actionsCreator.This.is.my.second.action(2021)
// {
// type: 'This/is/my/second/action',
// payload: 2021,
// }
// To get the type of action
String( actionsCreator.MY.FIRST.ACTION ) // 'MY/FIRST/ACTION'
// or
actionsCreator.MY.FIRST.ACTION().type // 'MY/FIRST/ACTION'
Sometimes we need the action to have callback capability. It might be necessary in many cases.
Actions Creator allows us to do this in a beautiful way:
When we try to generate an action object, we can pass the callback function as the last argument. Actions Creator will check and if the last argument is a function, it will be considered as a callback function.
import {actionsCreator} from 'actions-creator'
const callback = () => {
console.log('Hello, I am callback!!!')
}
const action = actionsCreator.MY.CALLBACKABLE.ACTION(123, callback)
// {
// type: 'MY/CALLBACKABLE/ACTION',
// payload: 123,
// cb: [Function callback],
// }
action.cb() // 'Hello, I am callback!!!'
actionsCreator.ANY.ACTION(payload, callback?)<Any><Function>Returns <Object>
<String> Action type as a string.
actionsCreator.ANY.ACTION().type === 'ANY/ACTION' // true
<Any> actionsCreator.ANY.ACTION(123).payload === 123 // true
<Function> const callback = () => {};
actionsCreator.ANY.ACTION(123, callback).cb === callback // true
We do not recommend to customize,
but if you need to do it, you can easily do that:
see: Produce By Path Pattern
Read our contributing guide to learn about our development process.
This project has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.
FAQs
actions-creator is an awesome javascript package that allows you to dynamically create action objects in Redux without having to declare constants and separate action-creator functions for each action.
We found that actions-creator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.