1.0.1 • Published 10 years ago
poor-mans-symbol v1.0.1
poor-mans-symbol
Poor man's Symbol implementation, not compliant. Uses
window.Symbolif present
This is not a polyfill, it's only good to be used to generate pseudo-private property keys.
Usage with npm and ES2015
npm install --save poor-mans-symbolimport PoorSymbol from './poor-mans-symbol';
const ಠ = PoorSymbol('my-nice-module');
el[ಠ] = 'Some private stuff';Usage without build tools
Copy the content of the file dist/poor-mans-symbol.browser.js into your code, don't load that file separately, it's too small. Then:
var ಠ = PoorSymbol('my-nice-module');
el[ಠ] = 'Some private stuff';License
MIT © Federico Brigante