Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Latest commit

 

History

History
35 lines (18 loc) · 1.22 KB

File metadata and controls

35 lines (18 loc) · 1.22 KB

@ceramic-sdk/model-instance-client v0.2.1Docs


Ceramic SDK / @ceramic-sdk/model-instance-client / createDataEventPayload

Function: createDataEventPayload()

createDataEventPayload(current, data, header?): DocumentDataEventPayload

Creates a data event payload for a ModelInstanceDocument stream.

Parameters

current: CommitID

The current commit ID of the stream.

data: (MapIn<object, $TypeOf> | MapIn<object, $TypeOf> | MapIn<object, $TypeOf> | MapIn<object, $TypeOf> | MapIn<object, $TypeOf> | MapIn<object, $TypeOf>)[]

The JSON patch operations to apply to the stream content.

header?: MapIn<RequiredProps<object>, $TypeOf> & MapIn<OptionalProps<object>, $TypeOf>

Optional header information for the data event.

Returns

DocumentDataEventPayload

A valid data event payload.

Throws

Will throw an error if the JSON patch operations are invalid.