Add Symbol.toStringTag to promise instance
See original GitHub issueAs for now, promise created by Bluebird does not have Symbol.toStringTag
, but have toString
method which returns "[object Promise]"
string. Having [Symbol.toStringTag]: "Promise"
make Object.prototype.toString.call(promise)
to return same string: "[object Promise]"
(as for now it will return "[object Object]"
string.
So, I suggest to add Symbol.toStringTag
property to bluebird’s promise prototype.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:52
- Comments:7
Top Results From Across the Web
Symbol.toStringTag - JavaScript - MDN Web Docs
toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object. It...
Read more >Symbol.toStringTag - JavaScript - UDN Web Docs: MDN Backup
The Symbol.toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object....
Read more >JavaScript | Symbol.toStringTag symbol - GeeksforGeeks
The Symbol.toStringTag is a well-known symbol and string valued property in JavaScript which is used in the creation of the default string ...
Read more >ES6 Promise / Typescript and the Bluebird Promise
I was dealing with. TS2322: Type 'Bluebird' is not assignable to type 'Promise'. Property '[Symbol.toStringTag]' is missing in type ...
Read more >CustomStore - The "Property '[Symbol.toStringTag]' is missing ...
toStringTag ]' is missing in type Promise<TEntity, any, ... you need to implement the data access logic in the CustomStore instance.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t understand why you think bluebird is incompatible with native promises in TypeScript - I’ve been happily using them together for quite a while. That fact is unrelated to how toStringTag behaves.
The fact that Bluebird promises and native ES6 promises are incompatible makes it very difficult to work with packages like Sequelize in TypeScript. Please consider implementing this change.