> TODO: description

Usage no npm install needed!

<script type="module">
  import acousticContentSdkReduxFeatureWchConfig from 'https://cdn.skypack.dev/@acoustic-content-sdk/redux-feature-wch-config';



Implementation of utility functions that help working with redux state.


One of the core principals of the redux pattern is to keep all state immutable. This implies that when updating a value we need to make a copy of the affected objects. The following functions help to limit the size of these copies.


The createUpdater creates an wrapper around an object. This wrapper allows to set or remove (deep) properties of the wrapped object without mutating it. The updater makes sure to only create the minimum set of shallow copies.


const myObject={...};
const updater = createUpdater(myObject);

updater.set('elements.text.value', 'newValue');

const newObject = updater.get();

The updater works similar to immer but without the overhead.

Invariance Checks

During development it is important to verify that objects are not getting mutated. Use the invariance checker to test this, but make sure to not include these checks in production builds for performance reasons.


const inv = invarianceChecker(myObject);
// do some operations

// validate that myObject has not been mutated