Popularity
0.5
Stable
Activity
0.0
Stable
14
2
0
Description
Promise wrapper with some sugar
Programming language: JavaScript
License: MIT License
Latest version: v2.4.5
OF alternatives and similar modules
Based on the "Control Flow" category.
Alternatively, view OF alternatives based on common mentions on social networks and blogs.
-
Bluebird
:bird: :zap: Bluebird is a full featured promise library with unmatched performance. -
Neo-Async
Neo-Async is thought to be used as a drop-in replacement for Async, it almost fully covers its functionality and runs faster -
observable-to-promise
Awesome Observable related stuff - An Observable is a collection that arrives over time. -
js-csp
CSP channels for Javascript (like Clojurescript's core.async, or Go) THIS IS AN UPSTREAM FORK -
promise-breaker
Helps you write libraries that accept both promises and callbacks. -
promise-memoize
Memoize promise-returning functions. Includes cache expire and prefetch. -
bluebird-co
A set of high performance yield handlers for Bluebird coroutines -
async-chainable
An extension to Async adding better handling of mixed Series / Parallel tasks via object chaining -
Publish / Subscribe
JavaScript implementation of the Publish/Subscribe pattern -
Simple-Series-Parallel
A minimalist utility module for running async functions in series or parallel
Appwrite - The Open Source Firebase alternative introduces iOS support
Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
Promo
appwrite.io
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OF or a related project?
README
π‘ππ¬ O F π‘ππ¬
Syntactic sugar for asynchronous functions, promises, generators and synchronous functions.
Deno version of module - π¬π¦ DenOf π¬π¦.
[OF](docs/example.webp?raw=true "OF")
π¬ Usage
import { ofAnyCase } from "@r37r0m0d3l/of";
const promise = () => new Promise((resolve, _reject) => {
resolve({ data: true });
});
const config = {
defaults: "π€· Default value in case of error",
error: new Error("π Custom error, replaces thrown error"),
retries: 3, // π Third time's a charm
timeout: 1000, // β±οΈ Delay before timeout error
};
// no error thrown
const [result, error] = await ofAnyCase(promise(), config);
console.log(result); // { data: true }
console.warn(error); // no error thrown, so it's undefined
πΊοΈ Discover more
<!-- Badges -->