when providing an initial value to the createChromeStorageStateHookLocal hook, and trying to access the data from chrome.storage.local.get, it returns undefined instead of the initial false.
P.S.: the hook is already mounted by the timechrome.storage.local.get was called.
export const SETTINGS_KEY = 'settings';
const INITIAL_VALUE = {
isDark: false,
};
export const useSettingsStore = createChromeStorageStateHookLocal(SETTINGS_KEY, INITIAL_VALUE);
chrome.storage.local.get([SETTINGS_KEY], async function (result) {
console.log(result.isDark) // undefined
});
when providing an initial value to the
createChromeStorageStateHookLocalhook, and trying to access the data fromchrome.storage.local.get, it returnsundefinedinstead of the initialfalse.P.S.: the hook is already mounted by the time
chrome.storage.local.getwas called.