refacto : cleaning the codebasebase again
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useSyncExternalStore } from "react";
|
||||
import {
|
||||
InteractionManager,
|
||||
type InteractionSnapshot,
|
||||
} from "@/stateManager/InteractionManager";
|
||||
import { InteractionManager } from "@/stateManager/InteractionManager";
|
||||
import type { InteractionSnapshot } from "@/types/interaction";
|
||||
|
||||
const manager = InteractionManager.getInstance();
|
||||
|
||||
@@ -12,11 +10,3 @@ export function useInteraction(): InteractionSnapshot {
|
||||
manager.getState.bind(manager),
|
||||
);
|
||||
}
|
||||
|
||||
export function useInteractionSelector<T>(
|
||||
selector: (state: InteractionSnapshot) => T,
|
||||
): T {
|
||||
return useSyncExternalStore(manager.subscribe.bind(manager), () =>
|
||||
selector(manager.getState()),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user