Sanity Library Reference Docs
Preparing search index...
@sanity/visual-editing
react
createDatasetMutator
Function createDatasetMutator
createDatasetMutator
(
comlink
:
VisualEditingNode
,
)
:
StateMachine
<
{
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
<
undefined
|
void
|
SanityDocument
<
(...)
>
,
{}
,
EventObject
,
>
,
>
|
ActorRefFromLogic
<
PromiseActorLogic
<
void
,
{}
,
EventObject
>
>
|
ActorRefFromLogic
<
ObservableActorLogic
<
WelcomeEvent
|
ReconnectEvent
|
MutationEvent
,
{}
,
EventObject
,
>
,
>
;
}
,
Values
<
{}
>
,
Values
<
{}
>
,
never
,
"fetchRemoteSnapshotTimeout"
|
"submitTransactionsTimeout"
,
"disconnected"
|
"connecting"
|
"reconnecting"
|
"connectFailure"
|
{}
,
"error"
|
"busy"
|
"ready"
,
DocumentMutatorMachineInput
,
NonReducibleUnknown
,
EventObject
,
MetaObject
,
{}
,
>
,
>
;
}
,
{}
,
Values
<
{
"add document actor"
:
{}
;
"emit mutation event"
:
{}
;
"emit pristine event"
:
{}
;
"emit rebased event"
:
{}
;
"emit sync event"
:
{}
;
"remove remote snapshot from context"
:
{}
;
"stop remote snapshot"
:
{}
;
}
,
>
,
never
,
never
,
"pristine"
,
string
,
DatasetMutatorMachineInput
,
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
:
{}
}
;
}
,
>
Parameters
comlink
:
VisualEditingNode
Returns
StateMachine
<
{
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
<
undefined
|
void
|
SanityDocument
<
(...)
>
,
{}
,
EventObject
,
>
,
>
|
ActorRefFromLogic
<
PromiseActorLogic
<
void
,
{}
,
EventObject
>
>
|
ActorRefFromLogic
<
ObservableActorLogic
<
WelcomeEvent
|
ReconnectEvent
|
MutationEvent
,
{}
,
EventObject
,
>
,
>
;
}
,
Values
<
{}
>
,
Values
<
{}
>
,
never
,
"fetchRemoteSnapshotTimeout"
|
"submitTransactionsTimeout"
,
"disconnected"
|
"connecting"
|
"reconnecting"
|
"connectFailure"
|
{}
,
"error"
|
"busy"
|
"ready"
,
DocumentMutatorMachineInput
,
NonReducibleUnknown
,
EventObject
,
MetaObject
,
{}
,
>
,
>
;
}
,
{}
,
Values
<
{
"add document actor"
:
{}
;
"emit mutation event"
:
{}
;
"emit pristine event"
:
{}
;
"emit rebased event"
:
{}
;
"emit sync event"
:
{}
;
"remove remote snapshot from context"
:
{}
;
"stop remote snapshot"
:
{}
;
}
,
>
,
never
,
never
,
"pristine"
,
string
,
DatasetMutatorMachineInput
,
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
:
{}
}
;
}
,
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Sanity Library Reference Docs
Loading...