0.1.0 • Published 7 years ago

deployable-mixin-instances v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

deployable-mixin-instances

Node Instances Mixin for use with MixWith

Install

npm install deployable-mixin-instances --save

yarn add deployable-mixin-instances

Usage

const mix = require('mixwith').mix
const MixinInstances = require('deployable-mixin-instances')
class Some extends mix((class {})).with(MixinInstances) {}

let default = Some.singleton

API

getInstance(name)

Get an exiting instance, can return undefined

newInstance(name, args)

Create a new instance

fetchInstance(name, args)

Fetch an existing or create a new instance

createInstance(name, args)

Create an instance, erroring if it already exists

clearInstances()

Clear all instance stored in the class

License

deployable-mixin-instances is released under the MIT license. Copyright 2016 Matt Hoyle

https://github.com/deployable/deployable-mixin-instances