mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
feat: setup redux store for settings
This commit is contained in:
@@ -23,3 +23,23 @@ export function withGroupedLogs<R = unknown>(label: string, fn: () => R): R {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const noop = (..._args: unknown[]) => {
|
||||
// noop
|
||||
};
|
||||
|
||||
const dummyLogger = {
|
||||
log: noop,
|
||||
info: noop,
|
||||
warn: noop,
|
||||
debug: noop,
|
||||
trace: noop,
|
||||
};
|
||||
|
||||
export function getLogger() {
|
||||
if (import.meta.env.ENABLE_PERF_LOG === '1') {
|
||||
return window.console;
|
||||
} else {
|
||||
return dummyLogger;
|
||||
}
|
||||
}
|
||||
|
||||
7
src/util/objects.ts
Normal file
7
src/util/objects.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function* enumObject<T>(obj: Record<string, T> | null | void): Generator<[string, T]> {
|
||||
if (obj && typeof obj === 'object') {
|
||||
for (const key in obj) {
|
||||
yield [key, obj[key]];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user