Signal

by

TomoT

Signal class

Constructor

new(): Signal

Creates a new Signal objects.

Properties

No property on this class.

Methods

Connect(Callback: function): Connection

Connects the function to the signal. When the signal fires, the function is called. If arguments were passed to the Signal:Fire() method, they are passed to function when calling it.


Wait(): any

Yields (stops) the current thread until the signal fires. If arguments were passed to the Signal:Fire() method, they are returned by the method.


Fire(...: any?): void

Fires the signal, calling all connected functions. If arguments were passed, they are also passed to each connected function when calling them.


Remove(): void

Safely removes the signal, preventing it from firing. This method should be called if the signal is not used.

Events

No events on this class.

Connection class Not creatable

Constructor

new(): Connection

Properties

Connected: boolean

Describes whether the connection is still alive. If Connection:Disconnect() has been called, this property is false.

Methods

Disconnect(): void

Disconnects the connection, preventing the connected function from being called.

Events

No events on this class.