Consider this simple Q promise object:
nesh> var p = functionThatReturnsPromise();
The REPL is kind enough to output the promise's state and value if I go:
nesh> p
{ state: 'fulfilled',
value:
{
// (data properties)
}
}
Suppose I indeed waited for the promise to fulfill, I can't get the value nor the state directly by p.value
or p.state
.
I can do something like:
nesh> var data
undefined
nesh> p.then(function(_data) { data = _data })
yet it feels clumsy and uncomfortable for fluent REPL workflow.
Any ideas?