You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Fabulous/Cmd.fs
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -188,27 +188,41 @@ module Cmd =
188
188
let inlinemsgOption(task:Task<'msgoption>)=
189
189
OfAsync.msgOption(task |> Async.AwaitTask)
190
190
191
-
/// Command to issue a message if no other message has been issued within the specified timeout
191
+
/// <summary>Creates a factory for Commands that dispatch a message only
192
+
/// if the factory produces no other Command within the specified timeout.
193
+
/// Helps control how often a message is dispatched by delaying the dispatch after a period of inactivity.
194
+
/// Useful for handling noisy inputs like keypresses or scrolling, and preventing too many actions in a short time, like rapid button clicks.
195
+
/// Note that this creates an object with internal state and is intended to be used per Program or longer-running background process
196
+
/// rather than once per message in the update function.</summary>
197
+
/// <paramname="timeout">The time to wait for the next Command from the factory in milliseconds.</param>
198
+
/// <paramname="fn">Maps a factory input value to a message for delayed dispatch.</param>
199
+
/// <returns>A Command factory function that maps an input value to a "sleeper" Command which dispatches a delayed message (mapped from the value).
200
+
/// This command is cancelled if the factory produces another Command within the specified timeout; otherwise it succeeds and the message is dispatched.</returns>
0 commit comments