call-me-maybe

WebJar for call-me-maybe

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

call-me-maybe
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

call-me-maybe
WebJar for call-me-maybe
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/limulus/call-me-maybe

Download call-me-maybe

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/call-me-maybe/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>call-me-maybe</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/call-me-maybe/
implementation 'org.webjars.npm:call-me-maybe:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/call-me-maybe/
implementation ("org.webjars.npm:call-me-maybe:1.0.1")
'org.webjars.npm:call-me-maybe:jar:1.0.1'
<dependency org="org.webjars.npm" name="call-me-maybe" rev="1.0.1">
  <artifact name="call-me-maybe" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='call-me-maybe', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "call-me-maybe" % "1.0.1"
[org.webjars.npm/call-me-maybe "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

call-me-maybe Build Status

Let your JS API users either give you a callback or receive a promise.

Usage

var maybe = require("call-me-maybe")

module.exports = function asyncFunc (cb) {
  return maybe(cb, new Promise(function(resolve, reject) {
    // ...
  }))
}

API

maybe(cb, promise)

If the callback cb is truthy, returns undefined and will call cb when promise is settled. The parameters passed to cb are standard error-first:

  • If promise is fulfilled, then it is called with the result of the promise: cb(null, result)
  • If promise is rejected, then it is called with the rejection error: cb(err)

If cb is falsey, then promise is returned.

Versions

Version
1.0.1