EventExtensions Module
Fluent extension operations on events.
Type extensions
Type extension | Description |
Full Usage:
this.add callback
Parameters:
'T -> unit
-
The function to call when the event is triggered.
Modifiers: inline |
|
Full Usage:
this.choose chooser
Parameters:
'T -> 'U option
-
The function to select and transform event values to pass on.
Returns: IEvent<'U>
An event that fires only when the chooser returns Some.
Modifiers: inline Type parameters: 'U |
Extended Type:
|
Full Usage:
this.filter predicate
Parameters:
'T -> bool
-
The function to determine which triggers from the event to propagate.
Returns: IEvent<'T>
An event that only passes values that pass the predicate.
Modifiers: inline |
Extended Type:
|
Full Usage:
this.map mapping
Parameters:
'T -> 'U
-
The function to transform event values.
Returns: IEvent<'U>
An event that passes the transformed values.
Modifiers: inline Type parameters: 'U |
Extended Type:
|
Full Usage:
this.merge evt2
Parameters:
IEvent<'Del2, 'T>
-
The second input event.
Returns: IEvent<'T>
An event that fires when either of the input events fire.
Modifiers: inline Type parameters: 'Del2 |
|
Full Usage:
this.pairwise ()
Parameters:
unit
Returns: IEvent<'T * 'T>
An event that triggers on pairs of consecutive values passed from the source event.
Modifiers: inline |
Returns a new event that triggers on the second and subsequent triggerings of the input event. The Nth triggering of the input event passes the arguments from the N-1th and Nth triggering as a pair. The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
Extended Type:
|
Full Usage:
this.partition predicate
Parameters:
'T -> bool
-
The function to determine which output event to trigger.
Returns: IEvent<'T> * IEvent<'T>
A tuple of events. The first is triggered when the predicate evaluates to true
and the second when the predicate evaluates to false.
Modifiers: inline |
Extended Type:
|
Full Usage:
this.scan (state, collector)
Parameters:
'U
-
The initial state.
collector : 'U -> 'T -> 'U
-
The function to update the state with each event value.
Returns: IEvent<'U>
An event that fires on the updated state values.
Modifiers: inline Type parameters: 'U |
Returns a new event consisting of the results of applying the given accumulating function to successive values triggered on the input event. An item of internal state records the current value of the state parameter. The internal state is not locked during the execution of the accumulation function, so care should be taken that the input IEvent not triggered by multiple threads simultaneously.
Extended Type:
|
Full Usage:
this.split splitter
Parameters:
'T -> Choice<'U1, 'U2>
-
The function to transform event values into one of two types.
Returns: IEvent<'U1> * IEvent<'U2>
A tuple of events. The first fires whenever splitter evaluates to Choice1of1 and
the second fires whenever splitter evaluates to Choice2of2.
Modifiers: inline Type parameters: 'U1, 'U2 |