setter-getterify
generates setters and getters for an object
Syntax
;
Example
var setterGetterify = ; var thing = some: 'properties' ;var coords = x: 0 y: 0 ; ; console;console; thingx = 123; console;console;
The values are not stored on the object
but in the properties
object. This can be used to keep them private and make sure they are only accessed with said setters/getters.
This is useful if you only care about that data when storing/retrieving the object for example.
The callbacks
parameter is entirely optional. Currently only afterGetting
is implemented.