industry-instance

0.3.0 • Public • Published

IndustryInstance Build Status

Defines a factory function that builds instances.

Usage

import { factory } from "industry"
import { instance } from "industry-instance"
 
class Test {
  constructor() {
    this.rand = Math.random()
  }
}
 
let test = factory(Test)
  .set("instance", instance)
 
test().rand      == test().rand       // true
test("key").rand == test("key").rand  // true
test("key").rand == test().rand       // false

/industry-instance/

    Package Sidebar

    Install

    npm i industry-instance

    Weekly Downloads

    6

    Version

    0.3.0

    License

    MIT

    Last publish

    Collaborators

    • winton