fast-getter
Shorthand for efficient, lazy, self-replacing getter.
Synopsis & Test
var getter = ; var events = ; { events;} { events; thisowner = owner;} ; var owner = ;var ownee = ownerownee;
This synopsis is also run as a test using markdown-code-blocks:
var assert = ;assert; events; assert;
You can also assign to the property, in which case the getter never runs:
var owner = ;ownerownee = 'some string'; assert;assert; console;
API
module.exports = (object, name, [enumerable=false], get) -> void
Defines a configurable property on object
. The get
function will be called
in the same context as any other ES5 getter, but only once per unique object
that the property is accessed on.
If enumerable
is true
then the property name will be made enumerable, this
defaults to false.
License
MIT