GithubHelp home page GithubHelp logo

Comments (5)

TysonMN avatar TysonMN commented on August 16, 2024

But it throttles all the messages [...]

Expected or desired behavior
All messages are throttled

Actual behavior
Only a particular message type is throttled

Did you enter the expected/desired behavior and actual behavior incorrectly?

from elmish.wpf.

marner2 avatar marner2 commented on August 16, 2024

@xperiandri the core dispatch loop of Elmish is single-threaded, so you would want to avoid generating messages in the first place that you don't want immediately applied to the model.

However, if what you're looking for is a way to avoid UI updates every time Elmish updates the model, look at the Threading and Threading.Core example. If you call startElmishLoop from a separate thread from the WPF main window thread (and then call Dispatcher.Run() on that thread), Elmish will use that thread to dispatch model updates independently of the main thread. This allows Elmish to save up multiple model updates in between calculating the full View Model update and sending NotifyPropertyChanged events to WPF (note how the example freezes the UI, but the Elmish model continues executing in the background).

Saying that out loud, I should probably wrap that in a separate top-level function that does all of the threaded housekeeping for you.

from elmish.wpf.

xperiandri avatar xperiandri commented on August 16, 2024

I need a way to wait 0.5 sec for messages to stop till I send a request to a server

from elmish.wpf.

TysonMN avatar TysonMN commented on August 16, 2024

This should easily be possible using Reactive and Binding.alterMsgStream.

https://fsprojects.github.io/FSharp.Control.Reactive/reference/fsharp-control-reactive-observablemodule.html

from elmish.wpf.

xperiandri avatar xperiandri commented on August 16, 2024

I use R3 instead. This is what I implemented

namespace eCierge.Elmish

open System

[<AutoOpen>]
module Dispatching =

    open Elmish
    open R3

    let asDispatchWrapper<'msg> (configure : Observable<'msg> -> Observable<'msg>) (dispatch : Dispatch<'msg>) : Dispatch<'msg> =
        let subject = new Subject<_> ()
        (subject |> configure).Subscribe dispatch |> ignore
        fun msg -> async.Return (subject.OnNext msg) |> Async.Start

    let throttle<'msg> timespan =
        /// Ignores elements from an observable sequence which are followed by another element within a specified relative time duration.
        let throttle (dueTime : TimeSpan) (source : Observable<'Source>) : Observable<'Source> = source.ThrottleLast (dueTime)
        throttle timespan |> asDispatchWrapper<'msg>

    [<Literal>]
    let DefaultThrottleTimeout = 500.0

    [<Literal>]
    let HalfThrottleTimeout = 250.0

open Elmish.Uno
open System.Runtime.InteropServices

[<AbstractClass; Sealed>]
type BindingT private () =

    static member twoWayThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWay (get, setWithModel = setWithModel)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayThrottle
        (
            get : 'model -> 'a,
            setWithModel : 'a -> 'model -> 'msg,
            [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float
        )
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayThrottle (get, setWithModel, (TimeSpan.FromMilliseconds timeout))

    static member twoWayThrottle (get : 'model -> 'a, set : 'a -> 'msg, timespan) : string -> Binding<'model, 'msg, 'a> =
        BindingT.twoWay (get, set)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayThrottle (get, set, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptThrottle
        (getOpt : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOpt (getOpt, setWithModel = setWithModel)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptThrottle
        (
            getOpt : 'model -> 'a option,
            setWithModel : 'a option -> 'model -> 'msg,
            [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float
        )
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptThrottle (getOpt, setWithModel, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOpt (get, set)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptThrottle
        (
            get : 'model -> 'a option,
            set : 'a option -> 'msg,
            [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float
        )
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptThrottle (get, set, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptThrottle
        (getVOpt : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOpt (getVOpt = getVOpt, setWithModel = setWithModel)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptThrottle
        (
            getVOpt : 'model -> 'a voption,
            setWithModel : 'a voption -> 'model -> 'msg,
            [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float
        )
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptThrottle (getVOpt, setWithModel, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptThrottle (get : 'model -> 'a voption, set : 'a voption -> 'msg, timespan) : string -> Binding<'model, 'msg, 'a> =
        BindingT.twoWayOpt (get, set)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptThrottle (get : 'model -> 'a voption, set : 'a voption -> 'msg, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float) : string -> Binding<'model, 'msg, 'a> =
        BindingT.twoWayOptThrottle (get, set, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get = get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, setWithModel : 'a -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayValidateThrottle
        (get : 'model -> 'a, set : 'a -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (getVOpt : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (getVOpt = getVOpt, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (getVOpt : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (getVOpt, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, setWithModel : 'a voption -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a voption, set : 'a voption -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string list, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string list, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string voption, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string voption, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
       (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string option, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> string option, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, setWithModel = setWithModel, validate = validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, setWithModel : 'a option -> 'model -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, setWithModel, validate, (TimeSpan.FromMilliseconds timeout))

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> Result<'ignored, string>, timespan)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidate (get, set, validate)
        >> Binding.alterMsgStream (throttle timespan)

    static member twoWayOptValidateThrottle
        (get : 'model -> 'a option, set : 'a option -> 'msg, validate : 'model -> Result<'ignored, string>, [<Optional; DefaultParameterValue(DefaultThrottleTimeout)>] timeout : float)
        : string -> Binding<'model, 'msg, 'a>
        =
        BindingT.twoWayOptValidateThrottle (get, set, validate, (TimeSpan.FromMilliseconds timeout))

from elmish.wpf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.