Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

deno
deno classes
class eventtarget
event target

What is the MessageEvent class in Deno?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

What is Deno?

Deno is a small, general-purpose runtime environment for JavaScript with first-class support for various interfaces, ECMAScript modules, and seamless TypeScript integration.

Class MessageEvent

Class MessageEvent returns a message passed as a parameter to its constructor:

class MessageEvent extends Event

Constructors

// message is of type string
constructor(type: string, eventInitDict?: MessageEventInit)

Properties

// data is the message
readonly data: any
// where is message coming from
readonly origin: string
readonly lastEventId: string

Syntax

interface MessageEventInit extends EventInit {
  data?: any;
  origin?: string;
  lastEventId?: string;
}

declare class MessageEvent extends Event {
  readonly data: any;
  readonly origin: string;
  readonly lastEventId: string;
  constructor(type: string, eventInitDict?: MessageEventInit);
}

RELATED TAGS

deno
deno classes
class eventtarget
event target
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring