Generator

The library expose some functions:

import { Generator } from 'redux-autoreducers'

constructor

Description: Instance constructor of Generator.

Params:

Param Type Required
rules Array of Rules True

Example:

const getAllRule = new Rule('GET_ALL');
const testRule = new Rule('TEST');
const generator = new Generator([getAllRule, testRule]);

generate

Description: Instance method to aggregate all rules to make ready to go reducer function with initial state.

Example:

const getAllRule = new Rule('GET_ALL');
const testRule = new Rule('TEST');
const generator = new Generator([getAllRule, testRule]);
const reducer = generator.generate();

results matching ""

    No results matching ""