diff --git a/packages/xstate-store/src/react.ts b/packages/xstate-store/src/react.ts index a445c49405..306221bcbb 100644 --- a/packages/xstate-store/src/react.ts +++ b/packages/xstate-store/src/react.ts @@ -1,5 +1,5 @@ import { useCallback, useRef, useSyncExternalStore } from 'react'; -import { Store, SnapshotFromStore, AnyStore } from './types'; +import { SnapshotFromStore, AnyStore } from './types'; function defaultCompare(a: T | undefined, b: T) { return a === b; diff --git a/packages/xstate-store/src/solid.ts b/packages/xstate-store/src/solid.ts index 7e2f779bf0..05bcd65904 100644 --- a/packages/xstate-store/src/solid.ts +++ b/packages/xstate-store/src/solid.ts @@ -1,6 +1,6 @@ /* @jsxImportSource solid-js */ import { createEffect, createSignal, onCleanup } from 'solid-js'; -import type { Store, SnapshotFromStore, AnyStore } from './types'; +import type { SnapshotFromStore, AnyStore } from './types'; function defaultCompare(a: T | undefined, b: T) { return a === b; diff --git a/packages/xstate-store/src/store.ts b/packages/xstate-store/src/store.ts index 3b1acd1487..41ddb38c7d 100644 --- a/packages/xstate-store/src/store.ts +++ b/packages/xstate-store/src/store.ts @@ -131,7 +131,7 @@ function createStoreCore< return { unsubscribe() { - eventListeners!.delete(wrappedHandler); + eventListeners.delete(wrappedHandler); } }; }, @@ -434,16 +434,10 @@ export function createStoreTransition< if (typeof assigner === 'function') { currentContext = updater - ? updater( - currentContext, - (draftContext) => - ( - assigner as StoreCompleteAssigner< - TContext, - StoreEvent, - TEmitted - > - )?.(draftContext, event, enqueue) + ? updater(currentContext, (draftContext) => + ( + assigner as StoreCompleteAssigner + )?.(draftContext, event, enqueue) ) : setter(currentContext, (draftContext) => Object.assign( diff --git a/packages/xstate-store/src/types.ts b/packages/xstate-store/src/types.ts index 9e36ed2ea6..78d60ae7dd 100644 --- a/packages/xstate-store/src/types.ts +++ b/packages/xstate-store/src/types.ts @@ -109,7 +109,7 @@ export interface Store< export type AnyStore = Store; -export type Compute = { [K in keyof A]: A[K] } & unknown; +export type Compute = { [K in keyof A]: A[K] }; export type SnapshotFromStore> = TStore extends Store