Skip to content

Commit

Permalink
resolve lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
with-heart committed Sep 19, 2024
1 parent b597d16 commit 3f6fc4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/xstate-store/src/react.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useRef, useSyncExternalStore } from 'react';
import { Store, SnapshotFromStore, AnyStore } from './types';
import { SnapshotFromStore, AnyStore } from './types';

function defaultCompare<T>(a: T | undefined, b: T) {
return a === b;
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-store/src/solid.ts
Original file line number Diff line number Diff line change
@@ -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<T>(a: T | undefined, b: T) {
return a === b;
Expand Down
16 changes: 5 additions & 11 deletions packages/xstate-store/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function createStoreCore<

return {
unsubscribe() {
eventListeners!.delete(wrappedHandler);
eventListeners.delete(wrappedHandler);
}
};
},
Expand Down Expand Up @@ -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<TContext, StoreEvent, TEmitted>
)?.(draftContext, event, enqueue)
)
: setter(currentContext, (draftContext) =>
Object.assign(
Expand Down
2 changes: 1 addition & 1 deletion packages/xstate-store/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface Store<

export type AnyStore = Store<any, any, any>;

export type Compute<A extends any> = { [K in keyof A]: A[K] } & unknown;
export type Compute<A> = { [K in keyof A]: A[K] };

export type SnapshotFromStore<TStore extends Store<any, any, any>> =
TStore extends Store<infer TContext, any, any>
Expand Down

0 comments on commit 3f6fc4a

Please sign in to comment.