Skip to content

Function: commitData

commitData(input): Promise\<AggregateSuccess\<SuccessResult> | AggregateError\<ErrorResult>>

Commits the transaction to the global dataset, syncing all subscribing components and connected Pods

Parameters

Name Type Description
input LdoBase A transactable linked data object

Returns

Promise\<AggregateSuccess\<SuccessResult> | AggregateError\<ErrorResult>>

Example

import { changeData } from "@ldo/connected";

// ...

const profile = connectedLdoDataset
  .using(ProfileShapeType)
  .fromSubject("https://example.com/profile#me");
const resource = connectedLdoDataset.getResource("https://example.com/profile");

const cProfile = changeData(profile, resource);
cProfile.name = "My New Name";
const result = await commitData(cProfile);

Defined in

packages/connected/src/methods.ts:76