question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bluebird.method or any other wrapper as ES6 Class method

See original GitHub issue

Hello! It’s not straight bluebird issue, but maybe community will help. How to declare ES6 Class method as Bluebird.method or Bluebird.coroutine? 😃

class View {
  constructor(options) { ... }
  someMethod() { ... }
}

I want someMethod to be coroutine

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
petkaantonovcommented, Jan 22, 2015

@benjamingr but the class syntax has no equivalent to annotations now, that’s a disappointing limitation and will mean one has to to keep using prototype syntax in some situations

0reactions
Kiechluscommented, Jun 29, 2017

Yes. Seems we can call yield only from within generator functions: https://github.com/tj/co/issues/148#issuecomment-56975641

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object method with ES6 / Bluebird promises - Stack Overflow
I am using node v0.11.14-nightly-20140819-pre on Windows with harmony flag. ... serviceMethod of Service object returns a promise. When I use User object...
Read more >
Thoughts On Defining Coroutines As Class Methods In Node ...
Here, you can see that we're using Bluebird's coroutine() method to define the doAsync() method on the Prototype of the Thing "class".
Read more >
Promise.promisifyAll - Bluebird JS
Class property is a property with a function value that has a non-empty .prototype ... in your application, you could create a wrapper...
Read more >
Async-class NPM | npm.io
Wraps static methods whose name ends with Async or are GeneratorFunctions. Any GeneratorFunction is wrapped with bluebird.coroutine(), and others with bluebird.
Read more >
Error handling with ES7's async/await - Edward Bramanti
For example, I do not think the addition of ES6 classes was a good ... which we can wrap our async function with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found