Home Reference Source
import {Message} from 'rabbit-hole'
public class | source

Message

A message.

Messages are exchanged between different execution contexts such as a worker and the main thread.

Constructor Summary

Public Constructor
public

constructor(action: Action)

Constructs a new message.

Member Summary

Public Members
public

A worker action.

public

error: ErrorEvent

An error.

Public Constructors

public constructor(action: Action) source

Constructs a new message.

Params:

NameTypeAttributeDescription
action Action
  • optional
  • default: null

A worker action.

Public Members

public action: Action source

A worker action.

When a message is sent to another execution context, it will be copied using the Structured Clone algorithm. This automatic process turns the message into a plain object. The explicit action flag serves as a reliable identifier.

public error: ErrorEvent source

An error.

If this is not null, something went wrong.