Options
All
  • Public
  • Public/Protected
  • All
Menu

External module monitor

The Monitor Module is useful to poll for changes, e.g. on the Burst blockchain, especially for confirmations of transactions

It is designed to be generic, such that it's not only usable for the blockchain also.

Monitors are serializable, such they can be persisted and restored, which is useful for web apps.

Index

Variables

Const consoleLogger

consoleLogger: ConsoleLogger = new ConsoleLogger()

A singleton instance of the ConsoleLogger

Const voidLogger

voidLogger: VoidLogger = new VoidLogger()

A singleton instance of the VoidLogger

Type aliases

MonitorFetchFunction

MonitorFetchFunction: function

This is the type definition for the monitor's fetch function. The fetch function will be called periodically by the monitor. It returns arbitrary data that will be processed by the MonitorPredicateFunction

Type declaration

    • (): Promise<T>
    • Returns Promise<T>

MonitorPredicateFunction

MonitorPredicateFunction: function

This is the type definition for the monitor's post-fetch processing function. This predicate function will be called immediately after the monitor fetched data using the MonitorFetchFunction. This function checks for a certain condition and returns true or false. On true the monitor stops fetching and triggers the Monitor.onFulfilled callback

Type declaration

    • (fetchData: T): boolean
    • Parameters

      • fetchData: T

      Returns boolean