rbxts-flamework / core

Flamework is an extensible game framework. It requires typescript and offers many useful features.
MIT License
112 stars 8 forks source link

Generic singletons #64

Closed Fireboltofdeath closed 1 year ago

Fireboltofdeath commented 1 year ago

Closes #63

Adds support for flamework:singleton and flamework:loadOrder.

Decorators, like Service and Controller, are expected to implement this metadata itself. For compatibility, singletons that are registered through Modding.resolveSingleton without the metadata will still be registered as a singleton.

Removes the return from ignite() as this changes the resulting type and it doesn't make sense to return internal state.

This also allows external singletons to be ignited if they're requested as a dependency. Previously, they were not ignited and were not safe to use.