Sanity Library Reference Docs
    Preparing search index...
    • Parameters

      • actor:
            | ActorRef<
                MachineSnapshot<
                    {
                        client: SanityClient;
                        documents: Record<
                            string,
                            ActorRefFrom<ReturnType<typeof createDocumentMutator>>,
                        >;
                        sharedListener?: Observable<
                            WelcomeEvent
                            | ReconnectEvent
                            | MutationEvent,
                        >;
                    },
                    | {}
                    | {}
                    | {}
                    | {}
                    | {}
                    | { documentId: string; type: "observe" }
                    | { documentId: string; type: "unobserve" }
                    | { documentId: string; type: "add document actor" }
                    | { documentId: string; type: "stop document actor" },
                    {
                        [key: string]:
                            | undefined
                            | ActorRefFromLogic<
                                StateMachine<
                                    {},
                                    | WelcomeEvent
                                    | ReconnectEvent
                                    | MutationEvent
                                    | {}
                                    | {}
                                    | {}
                                    | {}
                                    | {}
                                    | {}
                                    | {}
                                    | {}
                                    | {},
                                    {
                                        [x: string]: | undefined
                                        | ActorRefFromLogic<PromiseActorLogic<(...), (...), (...)>>
                                        | ActorRefFromLogic<PromiseActorLogic<(...), (...), (...)>>
                                        | ActorRefFromLogic<ObservableActorLogic<(...), (...), (...)>>;
                                    },
                                    Values<{}>,
                                    Values<{}>,
                                    never,
                                    "fetchRemoteSnapshotTimeout" | "submitTransactionsTimeout",

                                        | "disconnected"
                                        | "connecting"
                                        | "reconnecting"
                                        | "connectFailure"
                                        | {},
                                    "error"
                                    | "busy"
                                    | "ready",
                                    DocumentMutatorMachineInput,
                                    NonReducibleUnknown,
                                    EventObject,
                                    MetaObject,
                                    {},
                                >,
                            >;
                    },
                    "pristine",
                    string,
                    NonReducibleUnknown,
                    MetaObject,
                    {
                        context: (
                            __namedParameters: {},
                        ) => {
                            client: SanityClient;
                            documents: {};
                            sharedListener:
                                | undefined
                                | Observable<WelcomeEvent | ReconnectEvent | MutationEvent>;
                        };
                        id: "dataset-mutator";
                        initial: "pristine";
                        on: {
                            mutation: { actions: readonly ["emit mutation event"] };
                            observe: { actions: readonly ["add document actor"] };
                            pristine: { actions: readonly ["emit pristine event"] };
                            "rebased.*": { actions: readonly ["emit rebased event"] };
                            sync: { actions: readonly ["emit sync event"] };
                            unobserve: {
                                actions: readonly [
                                    "stop remote snapshot",
                                    "remove remote snapshot from context",
                                ];
                            };
                        };
                        states: { pristine: {} };
                    },
                >,
                | {}
                | {}
                | {}
                | {}
                | {}
                | { documentId: string; type: "observe" }
                | { documentId: string; type: "unobserve" }
                | { documentId: string; type: "add document actor" }
                | { documentId: string; type: "stop document actor" },
                {} | {} | {} | {} | {},
            >
            | ActorRef<Snapshot<undefined>, AnyEventObject, AnyEventObject>

      Returns actor is ActorRef<Snapshot<undefined>, AnyEventObject, AnyEventObject>