Skip to content
forked from suguru03/aigle

πŸ¦… Aigle is an ideal promise library which is faster and more efficient than other libraries. It is a production-ready library that implements the Promise A+ standard.

License

Notifications You must be signed in to change notification settings

acidburn0zzz/aigle

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

aigle

npm CircleCI Status Coverage Status

Aigle is an ideal promise library which is faster and more efficient than other libraries. On top of being an impressive benchmark exercise, it is a production-ready library that implements the Promise A+ standard.

Also it has a lot of async style functions, you can start using Promise easily.

Usage

node

npm install --save aigle
const Aigle = require('aigle');
const each = require('aigle/each');

Async/Await

async function getUsers(ids) {
  const users = await Aigle.map(ids, getUser);
  const targets = await Aigle.filter(users, filterUser);
  return targets;
}

async function getUsers(ids) {
  return await Aigle.map(ids, getUser)
    .filter(filterUser);
}

Convert synchronous functions to asynchronous functions

Aigle.mixin(require('lodash'));

return Aigle.map([1.1, 1.4, 2.2], n => Aigle.delay(10, n * 2)) // [2.2, 2.8, 4.4]
  .uniqBy(n => Aigle.delay(10, Math.floor(n))) // [2.2, 4.4]
  .sum() // 6.6
  .times() // [0, 1, 2, 3, 4, 5];
  .then(value => console.log(value)); // [0, 1, 2, 3, 4, 5];

browser

Recommend to use webpack, browserify, Rollup or any bundling tool.

or prebuilt scripts from here.

This will expose to global as window.Promise.

<script src="dist/aigle.min.js"></script>
window.Promise;

Functions

Core

prototype functions

class functions

Collections

prototype functions

class functions

Control flow

prototype functions

class functions

Utils

prototype functions

class functions

Debug

class functions

About

πŸ¦… Aigle is an ideal promise library which is faster and more efficient than other libraries. It is a production-ready library that implements the Promise A+ standard.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%