Skip to content

setting promise implementation does not seem to work #17

@bkw

Description

@bkw

If I understand the docs correctly, the following should work:

const PubSub = require('@google-cloud/pubsub');
const Promise = require('bluebird');

const pubsubClient = PubSub({
  projectId: 'some-project-1234',
  promise: Promise
});

pubsubClient.createTopic('test')
  .tap(console.log);

... but it throws with TypeError: pubsubClient.createTopic(...).tap is not a function, since the returned promise is a native one and not by bluebird.

Setting global.Promise to bluebird makes this example work, but that's besides the point.

I also tried setting it in the option object of the call to createTopic(), but that also fails.

Looking at common/utils, the promise option does not make it into the context of promisfy() there.

Environment details

  • OS: macOs 10.13.2
  • Node.js version: 9.2.1
  • npm version: 5.6.0
  • @google-cloud/pubsub version: 0.16.0

Metadata

Metadata

Labels

🚨This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions