@sanity/visual-editing
Version:
[](https://npm-stat.com/charts.html?package=@sanity/visual-editing) [](https://
8 lines (7 loc) • 386 B
TypeScript
import type { SanityDocument } from '@sanity/types';
import { type OptimisticReducer } from '@sanity/visual-editing/optimistic';
import { type Readable } from 'svelte/store';
export declare function useOptimistic<T, U = SanityDocument>(initial: T, reducer: OptimisticReducer<T, U> | Array<OptimisticReducer<T, U>>): {
value: Readable<T>;
update: (newPassthrough: T) => void;
};