I've just been playing with Promises and like them a lot.
I've just been playing with Promises and like them a lot. But one thing I find strange is that ".then()" creates a new promise, but with no way to reject it. ie. I can't write: return new Promise((resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. }).then((step1Val, resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. // But this doesn't actually work, because the "then" callback // doesn't get resolve/reject as args. }); Instead I'm having to write this as the following, which is more verbose: return new Promise((resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. }).then(new Promise((resolve, reject) = { // Do some stuff, call resolve()/reject() on success/failure. // But this way I don't get access to step1Val. })); Another bummer of this style is that that the second step doesn't get access to the first step's value.
Posted by haberman on Jul 6, 2015, 1:55 AM
Tags
Related issues
- The biggest problem with having an LLM do this, from what I've observed of at least frontier models, is that the way they are trained...
- The biggest problem with MOND is that it was hand-crafted with additional parameters simply to fit the data.
- (My comment is about detached houses).
- The biggest problem with this is that I can't run my company's own internal benchmarks against this API, because they will be trained int...
- > steer Claude away from over-engineering parts of the system in response to hypothetical concerns.
- Why is there no comparison with FLUX 3 Image?
Raise real-world problems, find people facing the same issue, and discuss solutions.5,500 issues0 comments
hackernews (Other)
The biggest problem with having an LLM do this, from what I've observed of at least frontier models, is that the way they are trained...
The biggest problem with MOND is that it was hand-crafted with additional parameters simply to fit the data.
(My comment is about detached houses).
The biggest problem with this is that I can't run my company's own internal benchmarks against this API, because they will be trained int...
> steer Claude away from over-engineering parts of the system in response to hypothetical concerns.
Why is there no comparison with FLUX 3 Image?
> our Git monorepo was developing an annoying problem Sentences like this are so common from people using monorepos that I am convinced ...
Why is there no contact form?
I've just been playing with Promises and like them a lot.
I've just been playing with Promises and like them a lot. But one thing I find strange is that ".then()" creates a new promise, but with no way to reject it. ie. I can't write: return new Promise((resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. }).then((step1Val, resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. // But this doesn't actually work, because the "then" callback // doesn't get resolve/reject as args. }); Instead I'm having to write this as the following, which is more verbose: return new Promise((resolve, reject) => { // Do some stuff, call resolve()/reject() on success/failure. }).then(new Promise((resolve, reject) = { // Do some stuff, call resolve()/reject() on success/failure. // But this way I don't get access to step1Val. })); Another bummer of this style is that that the second step doesn't get access to the first step's value.
Comments (0)
No comments yet. Start the discussion.