iFlow
is the core method of iFlow, which transforms a state & action mix into a pipe and pipe, an instance of pipe that contains multiple iFlow built-in prototype chain methods.
iFlow([stateAndAction])
stateAndAction(Object/Array/Function): structure requiring pipe instantiation
(*): returns the instantiated pipe
import iFlow from 'iflow'
const pipe0 = iFlow({
calculate(){},
counter: 0
})
class Counter {
counter = 0
calculate(){}
}
const pipe1 = iFlow(new Counter())
const pipe2 = iFlow([])