Lifts a single value or a function into a Promise-like object.
Provides a method of wrapping a single value or a function into a Promise,
in order that the following operation
may conform to the standard Promise operation.
In some scenario, we may first attempt to get a value from cache.
Motivation.
In this case, we need to return a value. However, if the value is
not available in the cache, we may have to go ahead to load it
asynchronously. Loading a value asynchronously usually returns
a Promise. To untify the return from two cases, we
escalate a single value into a Promise.
Transforms a given promise with additonal pipeline processing.
Specifically, in this method, compared to the given promise, the return
promise contains validating and adpating stages.
Lifts a single value or a function into a Promise-like object. Provides a method of wrapping a single value or a function into a Promise, in order that the following operation may conform to the standard Promise operation. In some scenario, we may first attempt to get a value from cache. Motivation. In this case, we need to return a value. However, if the value is not available in the cache, we may have to go ahead to load it asynchronously. Loading a value asynchronously usually returns a Promise. To untify the return from two cases, we escalate a single value into a Promise.