Closed klarkc closed 2 years ago
My guess is that vue "ref" function is effectful, so this gonna be helpful https://book.purescript.org/chapter10.html#effectful-functions
Source of inspiration of how to deal with hooks in the purs context:
https://gist.github.com/i-am-the-slime/eb0f9168e17277b4ff37de25dfe6816e
Effectful example in POC: 4d91e4c831b239fb5228afdca0a6e541c79a456a
My guess is that vue "ref" function is effectful, so this gonna be helpful https://book.purescript.org/chapter10.html#effectful-functions
The ref
function is not side-effect free because it uses reactive
, which uses a effectful function mutating reactiveMap
.
Fixed on 8f0bd65f74990ab555f93222bc4f52518daf64fa, changing Ref logic, it will be just a reference to the reactive object to be used inside Effect monad.
There still a problem, how set/get would know how to address the ref. The only solution that I think is to have side-effects on ref, requiring the use of Effect monad
I'm still considering this composition api approach, I'm seeing that composition api hides a lot of side-effects
Done in 7ff1b2a261a3268d07bc3f5e847d6cf8c2e2623b
I am looking for how purscript effect system could work with vue setup hook in a non intrusive way.