Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 454 Bytes

no-native.md

File metadata and controls

18 lines (13 loc) · 454 Bytes

In an ES5 environment, make sure to create a Promise constructor before using (no-native)

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.

Valid

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

Invalid

var x = Promise.resolve('bad')