Miss any of our Open RFC calls?Watch the recordings here! »

industry-state

0.0.5 • Public • Published

IndustryState Build Status

Allows Industry factory functions to receive one or more objects that update state.

Requirements

This extension requires that the factory function returns a stateful object.

At Inverse, we usually pair this extension with IndustryFactoryInstance.

Usage

import { factory } from "industry"
import { instance } from "industry-instance"
import { state } from "industry-state"
 
let test = factory()
  .set("instance", instance)
  .set("state", state)
  .base(class {})
 
test({ a: 1, b: 2 })
test().state() // { a: 1, b: 2 }
test({ c: 3 }, { d: 4 })
test().state() // { a: 1, b: 2, c: 3, d: 4 }

Keywords

none

Install

npm i [email protected]

Version

0.0.5

License

MIT

Last publish

Collaborators

  • avatar