In this lesson, we’ll use the plural createActions
function and an action map to create multiple action creators with a single utility from redux actions.
Excellent class, one question out of the topic, What is the font and theme that you are using?
The multi-line cursor is very cool!
The font is called "Operator Mono", I'm not sure about the theme.
I'm trying to implement this is a proof of concept. It works fine, the only issue is that if I try to namespace an action ie:
const SET_LIST = 'app/queries/SET_LIST';
the createActions
method will not properly camelcase the action. Is there a way around that? I've been Googling but I haven't come across a solution yet.
Chester,
You could nest the keys in your actionMap to get to your desired types.
From the docs:
If actionMap has a recursive structure, its leaves are used as payload and meta creators, and the action type for each leaf is the combined path to that leaf:
https://redux-actions.js.org/api/createaction#createactionsactionmap
Hope this helps!
tgdg