create
for pipe initialization and get store.
Initializing the middleware will affect the initialization assignment of create
, whichever is the last initialization middleware with the return value, and if not, the initialization value of the Create pass parameter.
create(initialValue)
initialValue (*): pipe initialized value
(Array/Object): returns the store after pipe initialization
const pipe = iFlow({
calculate (number) {
this.counter += number
},
counter: 0,
})
const store = pipe.create({counter: 100})