Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Last active October 7, 2018 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrattli/d0e491b4d26a6d454937469b72afef6e to your computer and use it in GitHub Desktop.
Save dbrattli/d0e491b4d26a6d454937469b72afef6e to your computer and use it in GitHub Desktop.
Callback
// Callback handler
let myCallback x =
printfn "Got %A" x
// Asynchronous function taking a callback handler
let asyncFun x cb =
let result = x * 10
cb result
// Call function with provided callback handler
asyncFun 42 myCallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment