Skip to content

Commit

Permalink
fix: remove remeda from derive implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoplaza committed Jul 8, 2024
1 parent 8eed6a8 commit 82ba521
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/derive.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -32,11 +31,11 @@ export function derive<
): Atom<TValue | Promise<Awaited<TValue>>> {
return atom((get) => {
try {
return pipe(
return soon(
soonAll(deps.map(get) as ExtractAtomsValues<TDeps>) as PromiseOrValue<
AwaitAtomsValues<TDeps>
>,
soon((values) => op(...values)),
(values) => op(...values),
) as TValue | Promise<Awaited<TValue>>;
} catch (err) {
return Promise.reject(err);
Expand Down

0 comments on commit 82ba521

Please sign in to comment.