@biorate/symbolic
TypeScript icon, indicating that this package has built-in type declarations

1.28.0 • Public • Published

Symbols factory

Symbols factory registry with namespaces

Example:

import { create } from '@biorate/symbolic';

const Namespace1 = create('Namespace1');
const Namespace2 = create('Namespace2');

/* auto-create symbol on property call */
console.log(Namespace1.Test1); // Symbol(Namespace1.Test)
console.log(Namespace1.Test1 === Namespace1.Test1); // true

console.log(Namespace1.Test2); // Symbol(Namespace1.Test)
console.log(Namespace1.Test1 === Namespace1.Test2); // false

/* namespace isolation */
console.log(Namespace2.Test1 === Namespace1.Test1); // false

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

Readme

Keywords

none

Package Sidebar

Install

npm i @biorate/symbolic

Weekly Downloads

11

Version

1.28.0

License

MIT

Unpacked Size

140 kB

Total Files

32

Last publish

Collaborators

  • llevkin