123456789101112131415161718192021222324252627282930313233 |
- import { create } from 'zustand';
- type State = {
- inApp: {};
- registration: {
- user: {
- username: string;
- email: string;
- password: string;
- };
- };
- };
- type Action = {
- registration: {
- updateRegistrationUserData: (registration: State['registration']['user']) => void;
- };
- };
- const store = create<State & Action>((set) => ({
- inApp: {},
- registration: {
- user: {
- username: '',
- email: '',
- password: ''
- },
- updateRegistrationUserData: (userData) =>
- set((state) => ({ registration: { ...state.registration, user: userData } }))
- }
- }));
- export default store;
|