Probably a very simple question, but here goes:
I'm using Bluebird promises, but I want to pass the value returned from one promise into another one as a parameter. My current code is thus:
Promise.props
reports: @app.Reports.getReports()
years: @app.Years.getYears()
.then (promised) =>
console.log promised
But really I want to be able to use promised.years
as the first parameter for getReports
, so it would be something like reports: @app.Reports.getReports(promised.years)
I tried nesting promises but it exploded. I tried getting the years promise from inside the reports definition, but it exploded.
Any ideas?
Thanks!