# Class: EntitySignal
A simple entity signal.
# Hierarchy
Signal<(entity:Entity) =>void>↳
EntitySignal
# Table of contents
# Constructors
# Methods
# Constructors
# constructor
• new EntitySignal()
# Inherited from
Signal<(entity: Entity) => void>.constructor
# Methods
# connect
▸ connect(callback, order?): SignalConnection
Subscribe to this signal.
# Parameters
| Name | Type | Description |
|---|---|---|
callback | (entity: Entity) => void | This callback will be run when emit() is called. |
order? | number | Handlers with a higher order value will be called later. |
# Returns
SignalConnection
# Inherited from
Signal.connect
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:27
# disconnect
▸ disconnect(callback): boolean
Unsubscribe from this signal with the original callback instance. While you can use this method, the SignalConnection returned by connect() will not be updated!
# Parameters
| Name | Type | Description |
|---|---|---|
callback | (entity: Entity) => void | The callback you passed to connect(). |
# Returns
boolean
# Inherited from
Signal.disconnect
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:35
# disconnectAll
▸ disconnectAll(): void
Disconnect all handlers from this signal event.
# Returns
void
# Inherited from
Signal.disconnectAll
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:39
# emit
▸ emit(...args): void
Publish this signal event (call all handlers).
# Parameters
| Name | Type |
|---|---|
...args | [entity: Entity] |
# Returns
void
# Inherited from
Signal.emit
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:43
# emitCollecting
▸ Protected emitCollecting(collector, args): void
# Parameters
| Name | Type |
|---|---|
collector | Collector<(entity: Entity) => void> |
args | [entity: Entity] |
# Returns
void
# Inherited from
Signal.emitCollecting
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:44
# getConnectionsCount
▸ getConnectionsCount(): number
# Returns
number
The number of connections on this signal.
# Inherited from
Signal.getConnectionsCount
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:16
# hasConnections
▸ hasConnections(): boolean
# Returns
boolean
true if this signal has connections.
# Inherited from
Signal.hasConnections
# Defined in
node_modules/typed-signals/dist/Signal.d.ts:20