Effect-TS / website

Source code for Effect's documentation website
https://www.effect.website
100 stars 83 forks source link

Switches for pipe vs gen #711

Closed lishaduck closed 3 months ago

lishaduck commented 3 months ago

What is the problem this feature would solve?

When reading the docs, it can be confusing as to what code looks like using pipes vs the gen* api.

I was trying to use gen for streams, which doesn't work. If I could tell the docs to use gen when possible, I would've known you couldn't. It would also be nice to see the pipes and the gen code (swap back and forth to compare).

What is the feature you are proposing to solve the problem?

It would be nice to be able to do something like riverpod does where you can toggle how you want to use Effect.

See: https://riverpod.dev/docs/introduction/why_riverpod (top left)

What alternatives have you considered?

Just don't

Self-serve?

I have no idea where one would start with this, but I suppose I'd be willing to try if y'all would like this.

mikearnaldi commented 3 months ago

Docs already prefers generators where possible and there is documentation on how to switch between one style and the other: https://effect.website/docs/guides/style/do

Gen in Stream is not possible

lishaduck commented 3 months ago

Docs already prefers generators where possible and there is documentation on how to switch between one style and the other: https://effect.website/docs/guides/style/do

I thought it might be nice to be able to compare the styles in the snippets, but I guess the recommendation is just to always use gen (for effects), so that isn't necessary. Am I understanding you correctly?