編集: 例を単純化しすぎたのかもしれません。もう一度試してみましょう
file1.js
import conditonFunction from './conditonFunction'
console.log(conditonFunction())
file2.js
import asyncFunction from './asyncFunction'
export const conditonFunction = () => {
if (condition) {
return 'this doesnt matter'
} else {
asyncFunction().then(res => {
return res[0].whatever
})
}
}
条件が満たされない場合、ログに記録されconditonFunctionた値を のres内部の値にしたいasyncFunction
私は何が欠けていますか?