Package Exports
- @rbxts-js/symbol-luau
- @rbxts-js/symbol-luau/src/init.lua
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts-js/symbol-luau) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Symbol
A Symbol object to mimic JavaScript's Symbol type.
API
Symbol()
Symbol(name: string?): SymbolCreate a new symbol object. Symbols use the newproxy function under the hood to create an opaque, unique sentinel value. The optional string value will be included in value returned by calling tostring on the resulting symbol.
local Foo = Symbol("Foo")
print(tostring(Foo)) -- prints: 'Symbol("Foo")'Symbol.for_
Symbol.for_(name: string)Returns globally-shared symbol for the provided name, creating it in a global registry if it has not yet been accessed. Symbol.for_ uses a global registry for the lifetime of the lua execution.
Types
Symbol
Calling Symbol.new returns an object with type Symbol.
License
Licensed under the MIT license (LICENSE.txt or http://opensource.org/licenses/MIT).