maybeCancel

Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

Signature

maybeCancel()
('a: Deferred 'f 's).() => 'a :: mutates 'a

Documentation

Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.

Properties

Source Code

Defined in source/concurrency/future/_deferred.js at line 58, column 21
maybeCancel() {
    if (Pending.hasInstance(this._state)) {
      this.cancel();
    }
    return this;
  }
Licence
MIT
Module
folktale/concurrency/future/_deferred
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)