The decorator function to be applied.
Rest
...args: any[]The target to which the decorator is applied (class, prototype, or constructor argument).
Optional
propertyKey: string | number | symbolThe property name or constructor argument index (optional).
decorate(injectable("SomeDependency"), SomeDependency);
decorate(inject("AnotherDependency"), SomeClass, "anotherDependency");
decorate(inject("AnotherDependency"), SomeClass, 0);
decorate(gamePhysicsSystem(), SomeSystem);
decorate(gamePreRenderSystem(), SomeSystem);
Applies a decorator manually to a target (class, property, or constructor parameter).
This utility function simplifies the process of programmatically applying decorators without using the @ syntax.
This is primarily useful in JavaScript where decorator syntax is not yet standardized.