industry-state
Immutable state for your factories.
Last updated 4 years ago by winton .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install industry-state 
SYNC missed versions from official npm registry.

IndustryState Build Status

Immutable state for your factories.

Requirements

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

Usage

import { factory } from "industry"
import { functions } from "industry-functions"
import { instance } from "industry-instance"
import { standard_io } from "industry-standard-io"
import { state } from "industry-state"

class Test {
  init() {
    this.state({ a: 1 })
  }

  a({ state: { a } }) {
    return a
  }
}

let test = factory(Test)
  .set("functions", functions)
  .set("instance", instance)
  .set("state", state)
  .set("standard_io", standard_io)

test({ b: 2 })
test().state() // { a: 1, b: 2 }
test.a() // { value: 1 }

Current Tags

  • 0.3.0                                ...           latest (4 years ago)

16 Versions

  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |