Open mikearnaldi opened 2 weeks ago
So far I think that the capitalization is sufficient. Types are generally capitalized. Uppercase generally signifies constants. JSDoc should take care of the rest.
If we wanted to be even more pedantic, we could add a Type
suffix, so:
Effect.SuccessType
Effect.ErrorType
Effect.ContextType
but to be honest I think this is unnecessary and overly verbose. I agree with @patroza that the capitalization should generally be sufficient, along with a JSDoc explaining what the value is intended to be used for.
One other option is a namespace:
typeof someEffect.Types.Success
But I think I prefer .Success etc directly on the type.
One other option is a namespace:
typeof someEffect.Types.Success
lol you mad..
can never have enough namespaces can we, we'd be back at square one: Effect.Effect.Success<typeof X>
.
then again it might be preferred over pre or suffixes, and it might address mikes concerns.
while
typeof someEffect.Types.Success
would be the most obvious, the more nested it is the less benefit it has over Effect.Effect.Success<typeof someEffect>
Like, if we just alias it to the module level then compared with an Effect.Success<typeof someEffect>
it's barely any different.
It has to be
typeof someEffect.Success
if at all 🤔 (name pending, I only mean the nesting)
In Schema we now added ability to extract types like:
typeof Person.Type
that makes it really nice to get the types, the same should be applied to things such as tags so one can dotypeof Service.Type
and to Effect so that one can dotypeof Effect.Success
etc.I do feel though that unless we prefix those fake properties somehow it can become confusing, one might argue that defining them in uppercase makes it clear that they are meant to be types and not real values.
This issue is to discuss on a standard.
cc @gcanti @tim-smart @IMax153 @datner @patroza @fubhy