4 - Async / Await
To use the new async/await syntax edit .babelrc file to add the following plugin
{
"presets": ["es2015", "stage-2"],
"plugins": [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]
}
You will need to install
npm install babel-plugin-transform-runtime --save-dev
And that's it.
Notices that await can only be used within an async function !
Check out this blog to better understand async/await