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

Readme

Keywords

none

Package Sidebar

Install

npm i industry-instance

Weekly Downloads

2

Version

0.3.0

License

MIT

Last publish

Collaborators

  • winton