Logo MVUish.Avalonia

Sub Module

Nested modules

Modules Description

Internal

Functions and values

Function or value Description

batch subs

Full Usage: batch subs

Parameters:
    subs : Sub<'Msg> seq

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'Msg

Aggregate multiple subscription sets into one.

subs : Sub<'Msg> seq
Returns: Sub<'Msg>

fromEvent id addHandler removeHandler map

Full Usage: fromEvent id addHandler removeHandler map

Parameters:
    id : string
    addHandler : EventHandler<'EventArgs> -> unit
    removeHandler : EventHandler<'EventArgs> -> unit
    map : 'EventArgs -> 'Msg

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'EventArgs, 'Msg

Subscribe to a .NET-style event (add/remove handler) and map its args into messages. dispatch is thread-safe; messages are processed on the UI thread by the program loop.

id : string
addHandler : EventHandler<'EventArgs> -> unit
removeHandler : EventHandler<'EventArgs> -> unit
map : 'EventArgs -> 'Msg
Returns: Sub<'Msg>

fromObservable id source

Full Usage: fromObservable id source

Parameters:
Returns: Sub<'Msg>
Type parameters: 'Msg

Bridge any observable of messages into a subscription. Disposing the subscription unsubscribes; the source keeps its own lifetime.

id : string
source : IObservable<'Msg>
Returns: Sub<'Msg>

fromRoutedEvent id target routedEvent map

Full Usage: fromRoutedEvent id target routedEvent map

Parameters:
    id : string
    target : 'Target
    routedEvent : RoutedEvent<'EventArgs>
    map : 'EventArgs -> 'Msg

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'Msg, 'EventArgs, 'Target (requires :> Avalonia.Interactivity.RoutedEventArgs and :> Avalonia.Interactivity.Interactive)

Subscribe to a routed event on a control with Direct/Bubble routing, without receiving handled events.

id : string
target : 'Target
routedEvent : RoutedEvent<'EventArgs>
map : 'EventArgs -> 'Msg
Returns: Sub<'Msg>

fromRoutedEventWith id target routedEvent routes handledEventsToo map

Full Usage: fromRoutedEventWith id target routedEvent routes handledEventsToo map

Parameters:
    id : string
    target : 'Target
    routedEvent : RoutedEvent<'EventArgs>
    routes : RoutingStrategies
    handledEventsToo : bool
    map : 'EventArgs -> 'Msg

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'Msg, 'EventArgs, 'Target (requires :> Avalonia.Interactivity.RoutedEventArgs and :> Avalonia.Interactivity.Interactive)

Subscribe to a routed event on a control with full control over routing strategies and handled-events-too behavior.

id : string
target : 'Target
routedEvent : RoutedEvent<'EventArgs>
routes : RoutingStrategies
handledEventsToo : bool
map : 'EventArgs -> 'Msg
Returns: Sub<'Msg>

interval id interval tick

Full Usage: interval id interval tick

Parameters:
    id : string
    interval : TimeSpan
    tick : unit -> 'Msg

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'Msg

Dispatch a tick message periodically. Ticks arrive on a thread-pool thread; the program loop marshals them to the UI thread.

id : string
interval : TimeSpan
tick : unit -> 'Msg
Returns: Sub<'Msg>

map idPrefix mapping sub

Full Usage: map idPrefix mapping sub

Parameters:
    idPrefix : string
    mapping : 'A -> 'Msg
    sub : Sub<'A>

Returns: Sub<'Msg>
Modifiers: inline
Type parameters: 'A, 'Msg

Map child messages into parent messages, scoping every child SubId with a prefix so children with the same ids never collide.

idPrefix : string
mapping : 'A -> 'Msg
sub : Sub<'A>
Returns: Sub<'Msg>

none

Full Usage: none

Returns: Sub<'Msg>
Type parameters: 'Msg

No subscriptions.

Returns: Sub<'Msg>

ofId id subscribe

Full Usage: ofId id subscribe

Parameters:
Returns: Sub<'Msg>
Type parameters: 'Msg

Build a single keyed subscription from a start function.

id : string
subscribe : Subscribe<'Msg>
Returns: Sub<'Msg>

untilDetached visual sub

Full Usage: untilDetached visual sub

Parameters:
Returns: Sub<'Msg>
Type parameters: 'Msg

End every subscription in the set when the visual detaches from the visual tree. The engine may also dispose the same disposables later; disposal runs once. All starts, stops, and detach events run on the UI thread, so there is no detach race. A detached subscription stays in the active set until the next diff removes it; its start function simply stops producing.

visual : Visual
sub : Sub<'Msg>
Returns: Sub<'Msg>

Type something to start searching.