Takes a string with embedded placeholders on the form ${varName}
.
Binds an Observable of a data object to this InterpolatedString, calling resolve when data arrives on the given Observable.
Note: This is largely the same as subscribing to the Observable and calling resolve with the received object, but differs in only subscribing to the Observable if and when there are listeners subscribed to this InterpolatedString.
Resolves the placeholders in the InterpolatedString with the key/values of the object given.
If all placeholders are resolved, and there are any changed to the resulting string, the InterpolatedString will
emit the string.
If not all placeholders are given in the object, and the InterpolatedString has previously emitted a string, it
will emit undefined
.
Note: Be aware that resolve(...)
is stateless in the sense that it does not remember and accumulate previous
keys/values. The placeholders are resolved against the object as given. If you want to accumulate properties one
at a time from different sources, use a PartialObject.
An InterpolatedString is a string with placeholder variables on the form
${varName}
, and extendsObservable<string | undefined>
, making it an Observable which emits the string with the placeholders replaced by actual string values. New subscribers will immediately receive the current value, if any, akin to aReplaySubject(1)
.