repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
Projectflow
stars
latest
clone command
git clone gitlawb://did:key:z6Mkfh4Y...QBEi/projectflowgit clone gitlawb://did:key:z6Mkfh4Y.../projectflowb3cded1async from playground1d ago| import { StateCreator } from "zustand"; |
| #2 | import type { User } from "../../../domain/entities"; |
| #3 | import { users } from "../../../infrastructure/mock-data/users"; |
| #4 | import type { StoreState } from "../store.types"; |
| #5 |
| #6 | export interface UserSlice { |
| #7 | users: User[]; |
| #8 | getUserById: (id: string) => User | undefined; |
| #9 | } |
| #10 |
| #11 | export const createUserSlice: StateCreator< |
| #12 | StoreState, |
| #13 | [], |
| #14 | [], |
| #15 | UserSlice |
| #16 | > = (get) => ({ |
| #17 | users, |
| #18 | getUserById: (id) => get().users.find((u) => u.id === id), |
| #19 | }); |
| #20 |