Store
It is a minimalist solution for synchronizing the state of applications or component systems that require controlled bidirectional data management.
Getting Started
Creating the store
import { createContext } from "@atomico/store";
const MyStore = createContext({ counter: 0 });
customElements.define("my-store", MyStore);Defining the store
import { c } from "atomico";
import { MyStore } from "./my-store";
export const MyApp = c(() => {
return (
<host>
<MyStore state={{ counter: 0 }}>
<slot />
</MyStore>
</host>
);
});Consuming the store
Bidirectional State Management?
Last updated
Was this helpful?
