0.41.3 • Published 1 year ago

@util.js/privates v0.41.3

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

@util.js/privates

JavaScript utility class for private member variables

@util.js/privates is part of Util.js.

Privates

Kind: global class
Access: public

new Privates()

JavaScript utility class for private member variables.

This class decreases some of the boilerplate of the WeakMap pattern as described by "Private Variables in JavaScript with ES6 WeakMaps" and "Privates In ES2015 Javascript Classes". This utility handles shallow copying at construction.

Private fields may become a part of the ECMA standard. The following is a StackOverflow answer to the question "Private properties in JavaScript ES6 classes": "Private fields are being implemented in the ECMA standard. You can start using them today with babel 7 and stage 3 preset." Wouldn't private fields make this class obsolete? Not necessarily. If each of your privates is a function (e.g., you want to lazy load all member variables), this class has convenience methods for that.

privates.call()

Calls this.get(thiz, property)().

Kind: instance method of Privates
Access: public

0.41.3

1 year ago

0.41.2

1 year ago

0.41.1

2 years ago

0.41.0

3 years ago

0.40.0

3 years ago

0.40.1

3 years ago

0.39.2

5 years ago

0.39.1

5 years ago

0.39.0

5 years ago

0.38.0

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.1

5 years ago

0.36.0

5 years ago

0.35.0

5 years ago

0.34.0

5 years ago

0.33.1

5 years ago

0.33.0

5 years ago

0.32.0

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.1

5 years ago