1.0.2 • Published 3 years ago

call-me-maybe v1.0.2

Weekly downloads
7,449,700
License
MIT
Repository
github
Last release
3 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-mocksvelte-component-libswagmockswagmock-allofswagmock-specificswagger-parser-kill-circularswagger-parser-xswagger2openapiswagger2openapi-lxwang2vue-compmentuui-json-schema-ref-parser@bpinternal/json-schema-to-typescript@blkmarketco/components-library@paztis/json-schema-ref-parsergenerator-bootstrap-boilerplate-templatejesusdemojson-schema-ref-parser-altjson-schema-ref-parser-kill-circularjson-schema-id-ref-parserjamuskalimkaba-dat-apikapok-jskappa-drivekappa-drive-mountkappa-scopeslazy-buildhypercore-promisifierhyperdrive-daemonhyperdrive-daemon-clienthyperarrayhypertrie-multigraphhot-zone-vuelitepie-datepicker-gabelive-indexm2m-chartjs-plugin-crosshairl2forlernakonfig-swagger2openapikrown_login_library@web4/bittrie-multigraph@web4/bitweb-dns@web4/chainstore@web4/chainstore-legacy@web4/unichain-promisifier@web4/chainstore-networker@vendit-dev/grpc-caller@tillschweneker/ckeditor5-build-strapi-wysiwyg-markdown@vitali_shcherbina/styled-lib@xliic/json-schema-ref-parser@xubill/free-swagger-userscript@zebracompany/f_editoramqplib-rpcapi-buildarifbudixzap-vue-captchaappcharge-checkout@gr2m/json-schema-ref-parser@harsha-jalan/ckeditor5-custom-build@abios/abios-redoc@haggholm/json-schema-ref-parser@eeston/grpc-caller@coboxcoop/drive@coboxcoop/log@coboxcoop/replicator@coboxcoop/repository@coboxcoop/space@coboxcoop/superusers@aleung/swagger2openapi@corestore/networker@hawkingnetwork/react-native-tab-viewchain_diggerswagger-parser-reftychenud7-act2tingzi-vuepressu-libraryusemail@basestorex/networker@basestore/networker@bcherny/json-schema-ref-parser@cappasityinc/json-schema-ref-parser@chiaraani/bouncing-ballypt-part
1.0.2

3 years ago

1.0.2-beta.1

3 years ago

1.0.1

10 years ago

1.0.0

10 years ago