Skip to content

deployable/node-deployable-mixin-instances

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published