GitHub

Classes

Events

By publishing events and subscribing to them from your class methods, you can implement an event driven architecture.

data.events.push({ name: 'CUSTOM_EVENT', payload: { ...someOtherData, instanceId: 'default' } })
  - method: onEventReceive
    type: READ
    handler: index.onEventReceived
    subscriptions:
      - name: CUSTOM_EVENT
        instanceId: $.instanceId
        filters:
          - $.userId:
              EX: true

You cannot subscribe write methods to events.


API Reference

Publishing Events

You should push your events into data.events array in the following model.

ParameterTypeRequiredDescription
namestringtrueEvent's name
payloadRecord<string, any>trueEvent's payload

Filters

You should push your events into data.events array in the following model.

ParameterTypeRequiredDescription
EXbooleanfalseChecks if the target value is not undefined
EQanyfalseChecks if the target value equals to given value
NEanyfalseChecks if the target value does not equal to given value
GTstring / numberfalseChecks if the target value is greater than given value
GTEstring / numberfalseChecks if the target value is greater than or equal to given value
LTstring / numberfalseChecks if the target value is less than given value
LTEstring / numberfalseChecks if the target value is less than or equal to given value
INstring / arrayfalseCross checks if values match according to the type of the values
NINstring / arrayfalseCross checks if values don't match according to the type of the values

IN and NIN have different working perspectives according to their types.

Target TypeProvided TypeDescription
arrayarrayChecks if target array contains any of provided array
arraystringChecks if target array contains provided string
stringarrayChecks if target string exists in provided array
stringstringChecks if target string contains provided string
Previous
Tasks & Scheduling