autodone

1.1.1 • Public • Published

autodone

A decorator for async functions that automatically calls done() on the returned promise

Usage

Decorate any function that returns a promise, including async functions:

@autodone
async componentDidMount() {
  ...
}

Important Notes

  • Use this decorator only when you never will use the promise returned from the async function. Once a promise has been marked as done, you cannot call any more methods on it.
  • Your promise library must implement done()

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i autodone

      Weekly Downloads

      3

      Version

      1.1.1

      License

      MIT

      Last publish

      Collaborators

      • ccheever
      • exponent
      • ide
      • skevy