react-lambda-state

1.0.7 • Public • Published

What is all about

This package giving ability to manage state with calculated fields in React app.

The state defined by model which may contain constants as well as arrow functions & formulas (string that actually executed)

Actions

Action types

  • DEL_PROP
  • SET_PROP
  • CLR_PROP
  • PUSH_PROP

Action functions (can be called directly)

  • delProp (rootState, payload : { name: string, prop: string|number })
  • setProp (rootState, payload : { name: string, value: any })
  • pushProp(rootState, payload : { name: string })
  • clrProp (rootState, payload : { name: string, value: any })

name parameter is a path to the property separated by '.' including arrays

Example:

state = { a: [10, 20, { c : 666 } ] }
setProp(state, {name:'a.2.c', value: 333})
// state === { a: [10, 20, { c : 333 } ] }

Supported internal functions

  • range
  • foreach
  • PVIF
  • FVIFA
  • PMT
  • IPMT
  • PPMT
  • DaysBetween
  • XNPV
  • XIRR

Readme

Keywords

none

Package Sidebar

Install

npm i react-lambda-state

Weekly Downloads

80

Version

1.0.7

License

Apache 2.0

Unpacked Size

168 kB

Total Files

24

Last publish

Collaborators

  • nosyara