Skip to content

Operations

createOperation()

Returns a LogicOperation.

Used for executing some logic.

ts
// app.ts
import { enableCapability, createOperation } from '@telia-ace/alliance-framework';

export default function () {
    enableCapability('theCapability', (args) => {
        return createOperation((ctx) => {
            // logic
        });
    });
}

Context

PropertyTypeDescription
complete OperationResolverOperation complete function.

createViewOperation()

Returns a ViewOperation.

Used for rendering a view.

ts
// app.ts
import { enableCapability, createViewOperation } from '@telia-ace/alliance-framework';

export default function () {
    enableCapability('theCapability', (args) => {
        return createViewOperation((ctx) => {
            // rendering logic
        });
    });
}

Context

PropertyTypeDescription
complete OperationResolverOperation complete function.
element HTMLElementElement to render into.

OperationResolver

A function in the target operation context used to complete the operation. Similar to resolve() for Promises.

ts
type OperationResolver = (result: SerializeableObject | null) => void;