Combining Actions
See original GitHub issueHere’s a simple utility function I’m using that merges multiple action maps together. Thought this might be worthy of adding to the core library, unless I’m missing an better approach:
export function combineActions(...actionsArray) {
return store => (
actionsArray.reduce((acc, actions) => {
actions = typeof actions === "function" ? actions(store) : actions
return Object.assign(acc, actions)
}, {})
)
}
Usage:
import { userActions, todoActions } from '../actions'
@connect((state, props) => {
return state
}, combineActions(userActions, todoActions))
export class App extends Component {
...
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
combineActions - redux-actions
Combine any number of action types or action creators. types is a list of positional arguments which can be action type strings, symbols,...
Read more >Combining actions in Flow - Power Platform Community
Is there any way I can combine all of my variables in a folder or an action that will keep them all together?...
Read more >Combining multiple actions in one view - Notarius Support
To perform combined actions: · From the My Computer view panel in ConsignO, select a folder or multiple files the same way you...
Read more >Building Your Playbook: Add Sets With Multiple Actions
There is incredible value in running sets with multiple actions, and the options are nearly endless - here's a few to get you...
Read more >Combining Actions - Totally Rad! Inc.
Using Actions Together. Most of the Totally Rad Actions can be combined together to create unique recipes for your images.
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
@jetako Yeah, I missed it. You’re right. I haven’t noticed that we have simple object actions. I will work on it tomorrow.
Hi @jetako
This surely can be useful. Can you add a PR with this?