3 isFunction: require('lodash/isFunction'),
5 var { from, of } = require('rxjs');
6 var runAsync = require('run-async');
9 * Resolve a question property value if it is passed as a function.
10 * This method will overwrite the property on the question object with the received value.
11 * @param {Object} question - Question object
12 * @param {String} prop - Property to fetch name
13 * @param {Object} answers - Answers object
14 * @return {Rx.Observable} - Observable emitting once value is known
17 exports.fetchAsyncQuestionProperty = function (question, prop, answers) {
18 if (!_.isFunction(question[prop])) {
23 runAsync(question[prop])(answers).then((value) => {
24 question[prop] = value;