Skip to content

Commit

Permalink
fix: fixed clone typing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Aug 18, 2021
1 parent 86af320 commit 4f109d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extensions/snapshot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function snapshotExtension<TState extends BaseState>(options?: Pa

function snapshot<TBranchState extends BaseState = TState>(branchCallback: BranchCallback<TState, TBranchState> = ((state: TState) => state) as any): Snapshot<TBranchState> {
const snapshotBranch = branchCallback(store.state);
const state = Object.freeze(clone(snapshotBranch));
const state = Object.freeze(clone(snapshotBranch)) as TBranchState;

return {
state,
Expand Down
2 changes: 1 addition & 1 deletion extensions/transaction/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function transactionExtension<TState extends BaseState>() {

function transaction<TPayload>(name: string, transactor: Transactor<TPayload>): Transaction<TPayload> {
return payload => {
const snapshot = clone(store.state);
const snapshot = clone(store.state) as ReadState<TState>;

const eventData = {
payload,
Expand Down

0 comments on commit 4f109d0

Please sign in to comment.