effect icon indicating copy to clipboard operation
effect copied to clipboard

Standardize Ref apis

Open jessekelly881 opened this issue 1 year ago • 0 comments

What is the problem this feature would solve?

Switching from a Ref to a ScopedRef involves a lot of changes to how apis are called.

Ref.make(false)
Ref.set(ref, true)

vs

ScopedRef.make(() => false)
ScopedRef.set(ref, Effect.succeed(true))

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

It would be nice to standardize these so that switching from Ref to ScopedRef doesn't require dramatically changing how the different fns are called.

I don't have a strong preference one way or another about which api is better but maybe .set and .setEffect fns might be useful.

What alternatives have you considered?

No response

jessekelly881 avatar Sep 25 '24 22:09 jessekelly881