mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* Resolve BENS names from URL directly to address page Fixes #1965 * fix tests
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
const useFeatureValue = (name, fallback) => {
|
|
try {
|
|
const value = JSON.parse(localStorage.getItem(`pw_feature:${ name }`));
|
|
if (value === null) {
|
|
throw new Error();
|
|
}
|
|
return { isLoading: false, value };
|
|
} catch (error) {
|
|
return { isLoading: false, value: fallback };
|
|
}
|
|
};
|
|
|
|
export default useFeatureValue;
|