Open shadowtime2000 opened 3 years ago
I think it would be best to hold off on this until aidenybai/lucia#7 is finished to make sure we don't have to create any breaking changes once components are implemented.
Maybe instead have the bind
function convert an atom into an object that can be more easily read by Lucia for reactivity.
<div l-use="clickerGame">
<p l-text="`$${store.val}`"></p>
<button l-on:click="store.dispatch(store.val + 1)">Click!</button>
</div>
import { Atom } from "luciex";
import { bind } from "luciex-lucia";
const ClickStore = new Atom<number>(0);
Lucia.use("clickerGame", {
store: bind(ClickStore)
});
It would be great to have simple bindings to connect this to Lucia. It would probably be really simple, just a wrapper around this: