diff --git a/src/atomWithProxy.ts b/src/atomWithProxy.ts index 6b97729..edf2d9b 100644 --- a/src/atomWithProxy.ts +++ b/src/atomWithProxy.ts @@ -3,7 +3,7 @@ import type { SetStateAction } from 'jotai/vanilla'; import { snapshot, subscribe } from 'valtio/vanilla'; const isObject = (x: unknown): x is object => - typeof x === 'object' && x !== null; + typeof x === 'object' && x !== null && !(x instanceof Promise); const applyChanges = (proxyObject: T, prev: T, next: T) => { (Object.getOwnPropertyNames(prev) as (keyof T)[]).forEach((key) => {