# Stored global state manipulation

We have seen in other sections, you can declare specific default and initial values for a Value component. But as you can imagine, for StoredValue components we need a way to globally declare these default and initial values.

# Current stored values

# VueValuesStore.setState(newState)

Sets a new current state.

Note

This function doesn't replace the current one, instead it sets every stored value for each field within the newState object. So if you want to substitute it, you will need to use removeAll function first.

# VueValuesStore.removeAll()

Deletes every value from the store ensuring the deletion triggers view updates.

# Default stored values

# VueValuesStore.setDefaultState(newDefaultState)

Sets (or replaces) a new global default state with the every default value you want to declare.

# VueValuesStore.setDefaultValue(uid, newDefaultValue)

Sets a new default value for the corresponding uid.

# VueValuesStore.getDefaultValue(uid)

Gets the default value for the corresponding uid.

# VueValuesStore.removeDefaultValue(uid)

Deletes the corresponding default value.

# VueValuesStore.resetAllToDefault()

Resets every stored value declared previously with defaultState a new global default state with the every default value you want to declare.

# Initial stored values

# VueValuesStore.setInitialState(newInitialState)

Sets (or replaces) a new global initial state with the every initial value you want to declare.

# VueValuesStore.setInitialValue(uid, newInitialValue)

Sets a new initial value for the corresponding uid.

# VueValuesStore.getInitialValue(uid)

Gets the initial value for the corresponding uid.

# VueValuesStore.removeInitialValue(uid)

Deletes the corresponding initial value.

# VueValuesStore.resetAllToInitial()

Resets every stored value declared previously with initialState a new global initial state with the every initial value you want to declare.