feat(store): add reactive state primitives (#311)

This commit is contained in:
rahim
2026-01-20 00:59:14 +11:00
committed by GitHub
parent eea4c512dd
commit beb8615c1c
56 changed files with 1073 additions and 2896 deletions
+10 -4
View File
@@ -37,12 +37,18 @@ export function isObject(value: unknown): value is object {
return value !== null && typeof value === 'object';
}
/**
* Check if a value is a plain object (not a class instance like Date, Map, etc).
*/
export function isPlainObject(value: unknown): value is Record<string, unknown> {
if (!isObject(value)) return false;
const proto = Object.getPrototypeOf(value);
return proto === null || proto === Object.prototype;
}
/**
* Check if a value is an AbortError.
*/
export function isAbortError(value: unknown): value is Error {
return (
value instanceof Error
&& value.name === 'AbortError'
);
return value instanceof Error && value.name === 'AbortError';
}