diff --git a/src/derive.ts b/src/derive.ts index 96727d0..473eeff 100644 --- a/src/derive.ts +++ b/src/derive.ts @@ -1,5 +1,4 @@ import { type Atom, type ExtractAtomValue, atom } from 'jotai/vanilla'; -import { pipe } from 'remeda'; import { soon } from './soon.js'; import { soonAll } from './soonAll.js'; @@ -32,11 +31,11 @@ export function derive< ): Atom>> { return atom((get) => { try { - return pipe( + return soon( soonAll(deps.map(get) as ExtractAtomsValues) as PromiseOrValue< AwaitAtomsValues >, - soon((values) => op(...values)), + (values) => op(...values), ) as TValue | Promise>; } catch (err) { return Promise.reject(err);