method then
Documentation for method then
assembled from the following types:
class Promise
From Promise
(Promise) method then
method then(Promise: )
Schedules a piece of code to be run after the invocant has been kept or broken, and returns a new promise for this computation. In other words, creates a chained promise. The Promise
is passed as an argument to the &code
.
# Use code onlymy = Promise.in(2);my = .then();say .result;# OUTPUT: «2 seconds are overresult»# Interact with original Promisemy = Promise.in(2).then(-> );say .result;# OUTPUT: «Kept2 seconds are overresult»