mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-12 01:18:39 +08:00
♻️ Remove “auto-persist” from the sample store
This commit is contained in:
parent
5b192f3cc7
commit
b77058e2aa
1 changed files with 4 additions and 10 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue