♻️ Remove “auto-persist” from the sample store

This commit is contained in:
Philipp Stracker 2025-01-13 17:08:59 +01:00
parent 5b192f3cc7
commit b77058e2aa
No known key found for this signature in database

View file

@ -41,23 +41,17 @@ const useHooks = () => {
// TODO: Replace with real property.
const sampleValue = usePersistent( 'sampleValue' );

const savePersistent = async ( setter, value ) => {
setter( value );
await persist();
};

return {
persist,
isReady,
sampleValue,
setSampleValue: ( value ) => {
return savePersistent( setSampleValue, value );
},
setSampleValue,
};
};

export const useState = () => {
const { isReady } = useHooks();
return isReady;
const { persist, isReady } = useHooks();
return { persist, isReady };
};

// TODO: Replace with real hook.