Comments (4)
@TheGrandmother
You first need to transpile your code to ES5, if you want the plugin to work as expected. That way, all the variables get hoisted to the top of the scope.
var cid, resp;
return Promise.resolve().then(function () {
return getCid(slackUsername);
}).then(function (_resp) {
cid = _resp;
return replyFn(`Creating time report for ${year} ${month} and ${cid}`);
}).then(function () {
return request.post(config.apiUrl + `/create-time-report/${cid}/${year}/${month}`);
}).then(function (_resp) {
resp = _resp;
});
from kneden.
Thanks for filing. Beware that this module is essentially unmaintained currently. Happy to leave this open, but it probably won't get fixed.
You may want to take a look at https://www.npmjs.com/package/fast-async
from kneden.
@loganfsmyth
Yhea I realized that, this has been another exercise in "don't just pull random npm packages" :p
Thanks for the tip! I siwtched to async-to-generators
but fast-async
seems much better :)
from kneden.
Getting this as well. Transpiling to ES5 for this to work is a major bummer, as my target is Node 6.
from kneden.
Related Issues (20)
- Example in readme improvement HOT 1
- Documentation: "syntax-async-functions" is also required. HOT 4
- Extra-Tick before sync-function is called HOT 1
- Can't get final result in "if-flow" case
- Doesn't work with es2015-classes HOT 1
- preset-env: "await is a reserved word" HOT 5
- Return not handled properly?
- Incorrect result with async arrow functions when not using `babel-preset-es2015` HOT 6
- Additional .then call incorrectly inserted HOT 16
- Conform to Babel plugin naming scheme HOT 8
- performance? HOT 1
- Why does awaiting resolve a new Promise? HOT 4
- hoisting _recursive deoptimizes for-in loops
- Usage alongside babel-preset-stage-* HOT 21
- Bug with variable order? HOT 1
- Doesn't allow to get a final result of an async function HOT 8
- Unnecessary extra tick HOT 4
- Return not working. HOT 3
- Setting local variables inside the promise not outside HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kneden.