Skip to content

PieLabs/calculator-reducer

Repository files navigation

calculator-reducer

A calculator reducer function, build a ui on it.

import reducer from 'calculator-reducer';
let state = {value: ''}
state = reducer(state, {type: 'input', value: '1'});
state = reducer(state, {type: 'input', value: '+'});
state = reducer(state, {type: 'input', value: '2'});
state = reducer(state, {type: 'equals'})
expect(state).toEqual({value: '3'});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published