Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfware/symbols
An iterator which generates Symbol's
https://github.com/cfware/symbols
Last synced: 29 days ago
JSON representation
An iterator which generates Symbol's
- Host: GitHub
- URL: https://github.com/cfware/symbols
- Owner: cfware
- License: mit
- Created: 2020-09-06T19:35:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T16:28:48.000Z (about 1 year ago)
- Last Synced: 2024-10-29T07:22:04.696Z (about 2 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @cfware/symbols [![NPM Version][npm-image]][npm-url]
An iterator which generates Symbol's
## Usage
```js
import Symbols from '@cfware/symbols';export [Bar1, Bar2] = Symbols;
export class Foo {
[Bar1] = 'protected field';
[Bar2]() {
return 'protected method';
}
}
```This allows declaration of protected fields. A primary goal is to be terser friendly,
the `Bar1` field will be safely shortened even when it is used across sources.[npm-image]: https://img.shields.io/npm/v/@cfware/symbols.svg
[npm-url]: https://npmjs.org/package/@cfware/symbols