Skip to content

Instantly share code, notes, and snippets.

@fabiodamasceno
Last active August 23, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiodamasceno/1f1cfa6764e63ecb8905e6573c138cce to your computer and use it in GitHub Desktop.
Save fabiodamasceno/1f1cfa6764e63ecb8905e6573c138cce to your computer and use it in GitHub Desktop.
//doSomething.js > es6 v2
import Promise from 'bluebird'
export function sum(a, b) {
return a + b
}
export default (a, b) => {
let p = new Promise()
if(a > b)
p.reject()
p.resolve()
}
//index.js
import doSomething from ‘./doSomething’
import {sum} from ‘./doSomething’ // –> importando somente a função necessária de forma explícita S2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment