Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 590 Bytes

getState.md

File metadata and controls

33 lines (26 loc) · 590 Bytes

getState method

Description

getState for pipe to get the status tree of the current store

Usage

getState(store)

Arguments

store(Array/Object): current store

Returned value

(Array/Object): returns the state of the path that needs to be taken

Examples

import iFlow,{ getState } from 'iflow'
const pipe = iFlow({
  calculate: external(async function (number) {
    // do async something
  }),
  counter: 0,
  foo: {
    bar: 88
  },
})
const store = pipe.create()
getState(store) // value: { counter: 0, foo: { bar: 88 } }