This class provides multiple ways to consume EnvironmentState properties synchronously and asynchronously, plus other options like marking properties as required, interpolating values in properties, etc. Typically this will be the class that is exposed to the rest of the application to get the properties.
The environment query is an interface that must be implemented to get the environment values. Can be integrated into any application using the provided default implementation or a custom one.
The transpileEnvironment and interpolation properties can be configured at query application level when instantiated, but the local options have preference over the application ones.
if you want to get the first not nil value on a time period using RxJS observables you can do it using filterNil() and the RxJS
take and timeout operators.
Environment Query
This class provides multiple ways to consume EnvironmentState properties synchronously and asynchronously, plus other options like marking properties as required, interpolating values in properties, etc. Typically this will be the class that is exposed to the rest of the application to get the properties.
The environment query is an interface that must be implemented to get the environment values. Can be integrated into any application using the provided default implementation or a custom one.
DefaultEnvironmentQuery
A basic implementation that can be instantiated from...
DefaultEnvironmentQuery
.Use cases
Table of Contents
getAll
Gets all the EnvironmentState properties.
containsAll
Checks if all the EnvironmentState property paths are available for resolution.
containsSome
Checks if some EnvironmentState property paths are available for resolution.
get
Gets the EnvironmentState property value.
Return a default value if undefined.
Convert the returned value to a target type.
Return the async value on due time.
Throws an
EnvironmentReferenceError
if the property is required.Transpile the returned value.
Transpile using the environment values.
When transpile, the local properties has preferences over environment.
Can change the interpolation characters.
The
transpileEnvironment
andinterpolation
properties can be configured at query application level when instantiated, but the local options have preference over the application ones.First not nil Observable
if you want to get the first not nil value on a time period using RxJS observables you can do it using
filterNil()
and the RxJS take and timeout operators.Errors