Property wrapper for type safety. Extends String to allow using strings as Property but with type checking.
Prefer the Property.of<T>(name) factory over new Property<T>(name) — shorter at the call site and keeps room for future interning.
Property.of<T>(name)
new Property<T>(name)
Static
Canonical factory. Reads as "a Property of T called name".
avatar.setProp(Property.of<number>('gold'), 100); Copy
avatar.setProp(Property.of<number>('gold'), 100);
Property wrapper for type safety. Extends String to allow using strings as Property but with type checking.
Prefer the
Property.of<T>(name)factory overnew Property<T>(name)— shorter at the call site and keeps room for future interning.