Skip to content

Notification

Arthur Guiot edited this page Aug 15, 2019 · 1 revision

A Notification is a container for information broadcast through a notification center to all registered observers.

A notification contains a name and an object. It is broadcast to by instances of NotificationCenter. The name is a tag identifying the notification. The object is any object that the poster of the notification wants to send to observers of that notification (typically, the data posted by the notification).

Structure

class Notification {
	constructor(name, object = null) {} // object is the data you want to share
}

Clone this wiki locally