dfx icon indicating copy to clipboard operation
dfx copied to clipboard

question: why use GenericTag as opposed to Context.Tag

Open adrian-gierakowski opened this issue 1 year ago • 3 comments

hi, just a quick question: why, after recent upgrade of effect, have you opted for using GenericTag instead of the class based pattern advertised on effect website (class MyService extends Context.Tag("MyService")<...>)

was it just the fastest path to adapt to the new api or was there any other factor?

Thanks!

adrian-gierakowski avatar Mar 15 '24 17:03 adrian-gierakowski

There wasn't really a need to switch, as unique identifiers are already made for all of the services.

tim-smart avatar Mar 15 '24 19:03 tim-smart

Thanks. Just asking as I was using this project previously as the reference for my explorations. Would you say then that in a new project one should use the class approach? Is there any practical difference between the two? Thanks again!

adrian-gierakowski avatar Mar 15 '24 22:03 adrian-gierakowski

The discord-bot project that uses this library is more application level code. I used Context.Tag there.

https://github.com/Effect-TS/discord-bot

tim-smart avatar Mar 16 '24 00:03 tim-smart