Skip to content

Latest commit

 

History

History
executable file
·
43 lines (25 loc) · 946 Bytes

README.pod

File metadata and controls

executable file
·
43 lines (25 loc) · 946 Bytes

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.