Skip to content

ichesnokov/middleclass-mixin-singleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NAME

middleclass.mixin.singleton - singleton mixin for middleclass OO library

SYNOPSIS

local MyClass = require('middleclass')('MyClass')
  :include(require('middleclass.mixin.singleton'))

-- Get the first instance
local obj1 = MyClass:instance()

-- Get the second instance, which is the same as the first one
local obj2 = MyClass:instance()

DESCRIPTION

This is a simple mixin that allows to have middleclass-based singletone objects. See "SYNOPSIS" section for usage example.

LICENSE

MIT/X11

AUTHORS

This code is taken from Love2d forums, where the author of middleclass itself published it. I only copied the code from there, modified it slightly according to my taste and released as a module.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages