Hegel: Magic Types vs Utility Types in docs

Created on 31 May 2020  ·  2Comments  ·  Source: JSMonk/hegel

let's rename Magic Types into something that does not sound like i am doing something wrong or unsafe see Magic (programming)

for example flow uses name Utility Types that sounds descriptive and does not sound scary

and typescript also uses name Utility Types (in side bar it's called Global Utility Types i wonder if there are Local Utility Types??)

enhancement question

Most helpful comment

IMHO, this still falls into the category of “utility types” or “builtin type utilities”. At the place where I work the magic is the thing avoided at all costs 😅

All 2 comments

I will think about it. I chose the name because some of the types make really magic things.
For example, $Throws changes actual function name.
Or, es example, $TypeOf, which takes as type argument variable/function/class identifier and have access to variable scopes instead of type scopes.

IMHO, this still falls into the category of “utility types” or “builtin type utilities”. At the place where I work the magic is the thing avoided at all costs 😅

Was this page helpful?
0 / 5 - 0 ratings