Structuring React and Redux Applications
Artem Sapegin
1736

I love to use this “duck convention” as well. The point where I got stuck a while ago; was at defining the constants:

The DO_SOMETHING_COOL from your example would quickly end up in being something like:

const EDIT = 'app/todos/EDIT';
const EDIT_SUCCESS = 'app/todos/EDIT_SUCCESS';
const EDIT_ERROR = 'app/todos/EDIT_ERROR';

Perhaps even with a PENDING and CANCELLED? That’s why I created and just released redux-define. See: https://github.com/smeijer/redux-define

The sample above would simply become:

const EDIT = defineAction('EDIT', [ERROR, SUCCESS], 'app/todos');

(shortened the action names due to medium.com comment width)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.