Skip to content

Commit d35fb08

Browse files
authored
+ Task.ofValue (#554)
1 parent cc644dc commit d35fb08

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/FSharpPlus/Extensions/Task.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,12 @@ module Task =
285285
(fun () -> body disp)
286286
(fun () -> if not (isNull (box disp)) then disp.Dispose ())
287287

288+
/// Creates a Task from a value
289+
let ofValue value = Task.FromResult value
290+
288291
/// Raises an exception in the Task
289292
let raise (e: exn) =
290293
let tcs = TaskCompletionSource<'U> ()
291294
tcs.SetException e
292295
tcs.Task
293-
#endif
296+
#endif

0 commit comments

Comments
 (0)