The Lake
Let's start by defining our global state. We'll use a simple array of todo items.
- Lake.ts
import { createRipples } from "@m-c2/ripple";
// Create a ripple lake with task list
const lake = createRipples({
tasks : {
todo : [], // todo list
done : [] // done list
} as {
todo : { id: string, text: string }[];
done : { id: string, text: string }[];
}
});
export const rippleHooks = lake[0]; // ripple hooks
export const rippleServices = lake[1]; // ripple services