Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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