Improving `taggedEnum` with Proxy for a Better API
I had an idea to make
If we use
@gcanti @Tim Smart What do you think? It's a better feeling api at the cost of a slight perf hit. This can be overloaded on the regular function object so that it's an opt-in api. I find myself using
taggedEnum better.If we use
Proxy we can get this api:@gcanti @Tim Smart What do you think? It's a better feeling api at the cost of a slight perf hit. This can be overloaded on the regular function object so that it's an opt-in api. I find myself using
State("Foo")({...}) pretty frequently, and it's not very good looking