effect-app / libs

The core libraries to build apps with Effect
44 stars 6 forks source link

chore(vue): align useMutation, useAction, return a plain object of re… #41

Closed jfet97 closed 1 year ago

jfet97 commented 1 year ago

I went with not using an ADT because is the simpler solution, but we can discuss about it, depending also on Enrico's take on this

patroza commented 1 year ago

@jfet97 very nice!

One thing I realised, would we maybe try merging useMutation and useAction via overloads?

Please add a changeset with pnpm changeset, with minor version bump (due to breaking change value -> success)

jfet97 commented 1 year ago

@patroza

I'm unsure about the difference between const cancel = () => run.value(f.interrupt) and const cancel = () => f.interrupt.runPromise if we want to unify those functions. Are those the same?

patroza commented 1 year ago

@jfet97 the run.value is more correct as it uses the same runtime as the actual running of the effects, though for cancellation it may not make a difference in practice, aligning it to run.value is good.