Skip to content

Utility functions for javascript promises and async/await

License

Notifications You must be signed in to change notification settings

panda-clouds/promise

Repository files navigation

PCPromise

maintained by PandaClouds.com

PCPromise provides utility functions for javascript promises and async/await.

Installation

  1. If you want to use this library, you first need to install the Node.js.

  2. When you install node.js, will also be installed npm.

  3. Please run the following command.

npm install --save @panda-clouds/promise

Usage

Node.js

const PCPromise = require('@panda-clouds/promise');

// example usage
async () => {
	await PCPromise.wait(5000) // pauses for 5 seconds without blocking the main thread
}

You can replace PCPromise with any variable.

Methods

Unit Tests are an additional resource for learning functionality.

- wait()

Pauses execution of that thread without blocking

Example:

async () => {
	await PCPromise.wait(5000) // pauses for 5 seconds without blocking the main thread
}

Contributions

Pull requests are welcome! here is a checklist to speed things up:

  • modify PCPromise.js
  • add unit tests in PCPromise.spec.js
  • run npm test
  • document method in README.md
  • add your name to 'Contributors' in README.md

Contributors

(Add your name)

About

Utility functions for javascript promises and async/await

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published