1.0.2 • Published 2 years ago

call-me-maybe v1.0.2

Weekly downloads
7,449,700
License
MIT
Repository
github
Last release
2 years ago

call-me-maybe Continuous Release

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.

@mrmlnc/readdir-enhanced@iamjoeker/swaggerize-routesvuedragdropuploadimages@kaishuu0123/oas-validator@kaishuu0123/swagger2openapi@jopaw/json-schema-ref-parser-with-used-ref-listbb-chat@frxf/frxf@fundefund/funde_cknoresca-tools-dev444js4cytoscape@saaspe/components@everything-registry/sub-chunk-1287swagger-jsblade-json-schema-ref-parserswagger-jsblade-swagger-parserswagger-harswagger-combineswaggerize-content-type-validated-routesvue-button-test1x-mockshinsrethinkdb-primusrethinkdb-streamsequelcomponentsvelte-component-libswagmockswagmock-allofswagmock-specificswagger-parser-kill-circularswagger-parser-xswagger2openapiswagger2openapi-lxwang2vue-compmentuui-json-schema-ref-parserchain_diggermiguelcostero-ng2-toastyjesusdemojamuskalimjson-schema-ref-parser-altjson-schema-ref-parser-kill-circularjson-schema-id-ref-parserhypertrie-multigraphhypercore-promisifierm2m-chartjs-plugin-crosshairmggauharlitepie-datepicker-gabelive-indexkonfig-swagger2openapikrown_login_librarygrpc-callerhot-zone-vuehyperdrive-daemonhyperdrive-daemon-clienthyperarraykapok-jskappa-scopeskappa-drivekappa-drive-mountkaba-dat-apilazy-buildl2forlernaparvan_componentsparvan_reactjs_componentsopen-swaggeropenapi-mockkoas-validatoroas-validator-lxwang2produce-package-keywordsprimus-graphqlpocket-authpauls-dat-apipauls-dat-api2pats-dat-apireact-form-component-libraryreact-rect-progressbarnois-react-toastswagger-parser-reftychenud7-act2tingzi-vuepressu-libraryusemail@anttiviljami/json-schema-ref-parser@apidevtools/swagger-parser@andrewosh/corestore-migration@aleung/swagger2openapi@basestorex/networker@basestore/networker@bcherny/json-schema-ref-parser@cappasityinc/json-schema-ref-parser@chiaraani/bouncing-ball@abios/abios-redoc@ddatabase/promisifier@ddrive/daemon-client@devorso/dcountdown@dhub/client@dhub/ddriveypt-partverify-img-codevformlmq@fedorif/json-schema-ref-parser
1.0.2

2 years ago

1.0.2-beta.1

2 years ago

1.0.1

9 years ago

1.0.0

9 years ago