@wener/console
Version:
Base console UI toolkit
22 lines (21 loc) • 570 B
JavaScript
import { createStore } from "zustand";
import { mutative } from "zustand-mutative";
export function createUserStore(init = {}) {
return createStore(mutative((setState, getState, store)=>{
return {
id: '',
displayName: '',
fullName: '',
loginName: '',
email: '',
roles: [],
...init,
load: (v)=>{
setState((s)=>{
Object.assign(s, v);
});
}
};
}));
}
//# sourceMappingURL=UserStore.js.map