2.0.0 • Published 8 years ago

delay-decorator v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

delay-decorator NPM version Build status

An ES7 decorator for delaying function calls. Uses setTimeout internally.

Installation

Install the package with NPM:

$ npm install delay-decorator

Usage

The following example should be self-explanatory:

import delay from "delay-decorator";

class Dog {
  @delay(2000)
  makeNoise() { return "Woof!" }
}

let dog = new Dog();
let promise = dog.makeNoise();
promise.then(noise => console.log(noise)); // Print "Woof!" after 2 seconds.
2.0.0

8 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago