January 2019
Intermediate to advanced
298 pages
7h 46m
English
Let's say we would like to double the value in the age future. As we do with lists, we can simply map a function over the future to do just this:
(def double-age (i/map age #(* % 2))) ;; #<Future@659684cb: #<Success@7ce85f87: 62>>
Another way to do something with the value of a future is to use the on-success event handler that gets called with the wrapped value of the future if it is successful:
(i/on-success ...