Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

598 B
Raw Blame
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector';

import { shallowEqual, type EqualityFn } from './selectorCore';

export * from './selectorCore';

/** React adapter for a React-free external-store subscription. */
export const useExternalStoreSelector = <Snapshot, Selected>(
  subscribe: (listener: () => void) => () => void,
  getSnapshot: () => Snapshot,
  selector: (snapshot: Snapshot) => Selected,
  isEqual: EqualityFn<Selected> = shallowEqual
): Selected => useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, selector, isEqual);