Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: SyncEvent<TSender, TEventArgs>

@react-form-builder/core.SyncEvent

Represents a synchronous event that can be subscribed to and invoked. Internal use only.

Type parameters

NameDescription
TSenderthe type of the object that raises the event.
TEventArgsthe type of the event arguments.

Constructors

constructor

new SyncEvent<TSender, TEventArgs>()

Type parameters

Name
TSender
TEventArgs

Accessors

isSubscribed

get isSubscribed(): boolean

Returns true if the object has subscribers, false otherwise.

Returns

boolean

true if the object has handlers registered for events, otherwise returns false.

Methods

dispose

dispose(): void

Dispose method to release all handlers.

Returns

void


invoke

invoke(sender, eventArgs): void

Invokes the event by calling all registered event handlers.

Parameters

NameTypeDescription
senderTSenderthe sender of the event.
eventArgsTEventArgsthe event arguments.

Returns

void


subscribe

subscribe(handler): void

Adds a handler to the list of subscribers.

Parameters

NameTypeDescription
handlerSyncEventHandler<TSender, TEventArgs>the handler function to be added.

Returns

void


unsubscribe

unsubscribe(handler): void

Removes the specified event handler from the list of handlers.

Parameters

NameTypeDescription
handlerSyncEventHandler<TSender, TEventArgs>the event handler to remove.

Returns

void