van
van copied to clipboard
state management? css?
how to manage state with vanjs, is this more of a SPA that can have client side routing, state etc?
also, an example with some well known css will be nice, e.g bootstrap 5.
Hello, VanJS is completely agnostic regarding css, routing. You can use whatever library you feel comfortable with
For the state magement look at all the examples
Among them Examples
Regards
Hi @laoshaw,
Here is an SPA example with client-side routing support, based on VanJS's powerful builtin state management and state derivation:
https://vanjs.org/demo#code-browser
@laoshaw - I just contributed an add-on for VanJS that adds routing, navigation and a navLink component, you can check it out here. It integrates with window.history.state for navigation based state, however that protocol is limited. I think using van.state or van.reactive (from the official X add-on) is sufficient for more complex application state.
Thanks!