Skip to content

fregante/poor-mans-symbol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poor-mans-symbol

Poor man's Symbol implementation, not compliant. Uses window.Symbol if present

gzipped size Travis build status gzipped size

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-symbol
import 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

About

Poor man's Symbol implementation, not compliant. Uses window.Symbol if present

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published