This service is responsible for mutating the EnvironmentState values. It is normally only needed for the load operation, and should not be exposed to the rest of the application unless for functional reasons the properties can be mutated at runtime. Each method returns an EnvironmentResult to make it easy to develop customizations.
EnvironmentService is an interface that must be implemented to mutate the environment store. Can be integrated into any application using the provided default implementation or a custom one.
Environment Service
This service is responsible for mutating the EnvironmentState values. It is normally only needed for the load operation, and should not be exposed to the rest of the application unless for functional reasons the properties can be mutated at runtime. Each method returns an
EnvironmentResult
to make it easy to develop customizations.EnvironmentService is an interface that must be implemented to mutate the environment store. Can be integrated into any application using the provided default implementation or a custom one.
DefaultEnvironmentService
A basic implementation that can be instantiated from...
DefaultEnvironmentService
.Use cases
Below are examples of the expected behavior and some custom implementation examples.
Table of Contents
reset
Resets the initial EnvironmentState to the provided one.
create
Creates a single new property in the EnvironmentState and returns an error if the path exists or the operation cannot complete.
update
Updates a single property from the EnvironmentState and returns an error if the path does not exist or the operation cannot be completed.
upsert
Creates or updates a single property from the EnvironmentState and returns an error if the operation cannot be completed.
delete
Deletes a single property from the EnvironmentState and returns an error if the path does not exist or the operation cannot be completed.
add
Adds a set of properties to the EnvironmentState overwriting the existing ones.
addPreserving
Adds a set of properties to the EnvironmentState preserving the existing ones.
merge
Adds a set of properties to the EnvironmentState merging the values and overwriting the existing ones.
mergePreserving
Adds a set of properties to the EnvironmentState merging the values and preserving the existing ones.
Log actions
An example implementation that overrides all methods to provide a log of the actions.