Skip to content

Files

Latest commit

 

History

History
27 lines (17 loc) · 618 Bytes

no-native.md

File metadata and controls

27 lines (17 loc) · 618 Bytes

Pattern: Missing Promise constructor before use

Issue: -

Description

Ensure that Promise is included fresh in each file instead of relying on the existence of a native promise implementation. Helpful if you want to use bluebird or if you don't intend to use an ES6 Promise shim.

Example of correct code:

var Promise = require('bluebird')
var x = Promise.resolve('good')

Example of incorrect code:

var x = Promise.resolve('bad')

Further Reading