backend/common/src/session_queue.ts
Methods |
constructor()
|
destroy |
destroy()
|
Returns :
void
|
enqueue | |||||||||
enqueue(type: EventType, event: () => void)
|
|||||||||
Type parameters :
|
|||||||||
Enqueues an event with a particular type to be executed in order. The event is provided in a callback to be able to defer the creation of the observable until the point where it has actually reached the front of the queue and is about to be executed. When specifying the event to be of type EventType.Refresh it will be deferred slightly such that events of type EventType.Submit take precedence, in which case the earlier refresh event becomes obsolete and will thus be skipped. Its subscriber will only receive a completion signal in that case. This behavior is relevant in the situation where a user has focus in a refresh field and clicks a button that sends the form. In this case, the field will first receive its blur event that causes the EventType.Refresh to be queued followed by the EventType.Submit shortly after that will then have to wait for the refresh to complete. The problem with this ordering is that the refresh event has caused validation warnings to be shown by Blueriq that would then immediately be accepted in the subsequent submit event (recall that Blueriq only shows a warning once and then allows to continue as normal). Moreover, for a non-validate event the refresh may cause validation errors to briefly appear for the refreshed field which is sub-optimal.
Parameters :
Returns :
Observable<R>
An observable that mirrors the observable as produced by the { |