utiljs-privatesdeprecated

JavaScript utility class for private member variables

Usage no npm install needed!

<script type="module">
  import utiljsPrivates from 'https://cdn.skypack.dev/utiljs-privates';
</script>

README

utiljs-privates

JavaScript utility class for private member variables

NPM Status

utiljs-privates is part of Util.js.

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.

Use of this class should end once private fields 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."

Kind: global class
Access: public