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: Ui/App.fs
+61-1Lines changed: 61 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -175,14 +175,74 @@ module App =
175
175
176
176
command
177
177
178
+
/// <summary>
179
+
/// Creates a Command factory that dispatches the most recent message in a given interval - even if delayed.
180
+
/// This makes it similar to <seecref="throttle"/> in that it rate-limits the message dispatch
181
+
/// and similar to <seecref="debounce"/> in that it guarantees the last message (within the interval or in total) is dispatched.
182
+
/// Helpful for scenarios where you want to throttle, but cannot risk losing the last message to throttling
183
+
/// - like the last progress update that completes a progress.
184
+
/// Note that this function creates an object with internal state and is intended to be used per Program or longer-running background process
185
+
/// rather than once per message in the update function.
186
+
/// </summary>
187
+
/// <paramname="interval">The minimum time interval between two consecutive Command executions in milliseconds.</param>
188
+
/// <paramname="fn">A function that maps a factory input value to a message for dispatch.</param>
189
+
/// <returns>
190
+
/// A Command factory function that maps an input value to a "buffered throttle" Command which dispatches the most recent message (mapped from the value)
191
+
/// if the minimum time interval has elapsed since the last Command execution; otherwise, it does nothing.
0 commit comments