Based on the awesome project redux-actions
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}`);