helix

hadils 2024-05-14T12:56:33.340199Z

Can someone give me a pointer on how to use re-frame (not refx) with helix? I like refx but I need things that later versions of re-frame offer and I don’t have time to fix refx. There was a thread by @danvingo about using a react hook but I don’t get it yet.

peterh 2024-05-22T17:39:56.580419Z

I just tried this code @danvingo mentioned and it seems to work fine, thanks for sharing! Don’t really like that I still need the Reagent dependency, but of course that is inevitable. Hopefully, re-frame some day decides to become independent, because it still works so incredibly well for me. Btw, in case someone else runs into this issue: when using use-callback from helix.hooks, remember that the dependency vector needs to be the first form. In UIx it is the other way around, so the forms have to be swapped.

dvingo 2024-05-22T23:27:08.012449Z

For the reagent dependency - if you inspect the build report it should only ~8kb - the reagent.ratom namespace. The UI/component code shouldn't be used if you're just using re-frame.

peterh 2024-05-22T23:29:47.857619Z

Oh, that’s good to know!

hifumi123 2024-05-16T01:17:55.380199Z

use-sync-external-store is only needed for React 17 and earlier. Also scheduler is a transitive dependency of react

dvingo 2024-05-14T13:04:18.611729Z

Have you seen https://github.com/pitch-io/uix/blob/master/docs/interop-with-reagent.md#syncing-with-ratoms-and-re-frame ? Copying that to your project should allow using re-frame from helix

dvingo 2024-05-14T13:07:49.127389Z

you'll have to npm install a few packages: https://www.npmjs.com/package/scheduler - this may already be included with react https://www.npmjs.com/package/use-sync-external-store

hadils 2024-05-14T13:22:45.355219Z

Thanks @danvingo !

👍🏼 1
😎 1
emccue 2024-05-18T22:34:42.932299Z

I just wouldn't

hadils 2024-05-14T12:58:35.679019Z

Basically I have a hook, but I am getting WARN re-frame: Subscribe was called outside of a reactive context.