ractionx
v1.0.6
Published
A wrapper for acdlite/redux-actions that allows you to prefix types in actions
Downloads
2
Readme
redux-actions
Based on the awesome project redux-actions
Why another redux-actions package ?
Actually I just wrap a single function: createActions which now only receives an arbitrary number of string literals and supports their type to be prefixed
const prefix = 'some_random_prefix';
const types = [
'SOME_RANDOM_TYPE_1',
'SOME_RANDOM_TYPE_2',
'SOME_RANDOM_TYPE_3',
];
const {
someRandomType1,
someRandomType2,
someRandomType3,
} = createActions(prefix, types);
expect(someRandomType1().type).toEqual(`${prefix}/${type1}`);
expect(someRandomType2().type).toEqual(`${prefix}/${type2}`);
expect(someRandomType3().type).toEqual(`${prefix}/${type3}`);