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
Property | Type | Description |
---|---|---|
complete | OperationResolver | Operation 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
Property | Type | Description |
---|---|---|
complete | OperationResolver | Operation complete function. |
element | HTMLElement | Element 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;