@@ -163,6 +163,9 @@ module Cmd =
163163
164164 [ bind >> start ]
165165
166+ (* TODO this doesn't use Async.Catch - is that intended?
167+ Is this misplaced here or should that be documented?
168+ Or is there some magic involved that turns an exn into None? *)
166169 /// Command that will evaluate an async block and map the success
167170 let performOption ( start : Async < unit > -> unit ) ( task : 'a -> Async < _ option >) ( arg : 'a ) ( ofSuccess : _ -> 'msg ) : Cmd < 'msg > =
168171 let bind dispatch =
@@ -176,6 +179,12 @@ module Cmd =
176179
177180 [ bind >> start ]
178181
182+ //TODO Feel free to trim the fat from this description.
183+ (* TODO There are some caveats and warnings against using Async.Start in the chapter behind that first link.
184+ Do they need to be reflected here? *)
185+ (* TODO When would I use this instead of OfAsyncImmediate?
186+ Why would I not always use OfAsyncImmediate? Are there some typical use cases?
187+ How can we help devs decide which sub-module to use? *)
179188 /// For building Commands from Async functions queued to be run in the background, started on a thread pool thread using Async.Start.
180189 /// Suitable for long-running or CPU-bound computations where you want to free up the UI thread to remain responsive to do other work.
181190 /// See https://learn.microsoft.com/en-us/dotnet/fsharp/tutorials/async#asyncstart
@@ -202,6 +211,10 @@ module Cmd =
202211 let inline msgOption ( task : Async < 'msg option >) =
203212 OfAsyncWith.performOption Async.Start ( fun () -> task) () id
204213
214+ (* TODO I took parts of this description from the link source,
215+ suggesting this has an effect on async ops updating the UI.
216+ But using Cmd.OfAsync seems to work just fine for them as well. So why use this then?
217+ Is there an example out there demonstrating the effect - or can one be made up? *)
205218 /// For building Commands from Async functions started immediately on the current operating system thread
206219 /// using Async.StartImmediate. This is helpful if you need to update something on the calling thread during the computation.
207220 /// For example if an asynchronous computation must update a UI (such as updating a progress bar).
0 commit comments