Skip to content

Commit

Permalink
fix(bang): return state proxy to derive
Browse files Browse the repository at this point in the history
  • Loading branch information
Chau Tran authored and Chau Tran committed Jan 28, 2022
1 parent b26d0b7 commit 1c9f4a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ngx-bang/src/lib/derive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
DeriveFns,
DeriveSourceObjectEntry,
DeriveSubscription,
Snapshot,
} from './types';
import {
getDerives,
Expand Down Expand Up @@ -190,7 +191,7 @@ export function derive<TDerive extends object>(
}

dependencies.set(p, { v: getVersion(p) as number });
return getSnapshot(p);
return p as Snapshot<P>;
};
const value = fn(get, getSnapshot(derivedProxy));
const subscribeToDependencies = () => {
Expand Down

0 comments on commit 1c9f4a7

Please sign in to comment.