You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.
Originally, I thought it was wise to freeze the returned factory, basically to keep factories immutable, and limit the amount unanticipated consequences. The challenge is that it makes it impossible to add static methods/properties to the factory.
There are three approaches I can see to resolving this:
Don't recommend/support static properties or methods. If the default export of a module is a factory, it is "better" from a potential code optimisations mechanism, to export static methods related to the factory as part of the module. Of course, this may not gracefully handle typing with downstream composites.
Don't freeze the factories
Add an API to allowing the addition of static properties. The challenge will how to handle the type inference to return an extension of the ComposeFactory. Likely we would need TS 1.8 with F bound polymorphism (see: Type parameters as constraints microsoft/TypeScript#5949).
If we choose either of the last two, we will have to change the factory cloning logic to perpetuate these static method/properties, which it currently does not do.
The text was updated successfully, but these errors were encountered:
Originally, I thought it was wise to freeze the returned factory, basically to keep factories immutable, and limit the amount unanticipated consequences. The challenge is that it makes it impossible to add static methods/properties to the factory.
There are three approaches I can see to resolving this:
If we choose either of the last two, we will have to change the factory cloning logic to perpetuate these static method/properties, which it currently does not do.
The text was updated successfully, but these errors were encountered: