fallback takes an array of Tasks and uses it as a fallback plan. For each value in
the array, if it doesn't resolve to a successful value, the fallback plan will try the next.
This returns a Promise that resolves to the successful value or rejects with the final error in
the plan.
Example
Using the fallback-plan, the code in the docs could be rewritten:
fallbacktakes an array of Tasks and uses it as a fallback plan. For each value in the array, if it doesn't resolve to a successful value, the fallback plan will try the next.This returns a Promise that resolves to the successful value or rejects with the final error in the plan.
Example
Using the
fallback-plan, the code in the docs could be rewritten:Actually, you could go a step further, since the call to
getDefaulthas no parameters:since
fallbackhandles: