Skip to content

Action Event

suspense()

IMPORTANT

On this event its very important to notice that suspense function has to be implemented if you are listening to the event. it will take all functions (that returns a Promise) inside and waiting for them to resolve - it's required in the suspense function to have a minimum of 1 promise getting reolved or rejected!

type

typescript
function suspense(fn: () => Promise<void>): void

Example

javascript
     window.sdk.on('action', (event) => {
        e.suspense(async () => {
        await someAsynchronousAction();
        });
     })

preventDefault()

Cancel any queued action while suspensing the action. when suspense is resolved, no action would happen.

type

typescript
function preventDefault(): void
javascript
window.addEventListener('lf-sdk-ready', async () => {
  window.sdk.on('action', (e) => {
    e.suspense(async () => {
      e.preventDefault()
    });
  });
});

Origin

returns an object that contains information of the origin of action. there is the following origin sources:

Flowpage

propertyaccesstype
idread onlynumber
titleread onlystring or undefined
formFieldsread onlyformField
rowsread onlyrow

button addon

propertyaccesstype
aliasread onlystring
labelread onlystring or undefined

image addon

propertyaccesstype
aliasread onlystring
altread/writestring or undefined
sourceread/writestring or undefined

column

propertyaccesstype
idread onlynumber
labelread onlystring or undefined
addonsread only