State: Settings
State is required for app settings. This state will require actions to update the current settings, a state interface describing the structure of the state, a reducer to handle changes to settings, and selectors to retrieve the current settings.
Actions should be created with the NgRx createAction
utility function.
Selectors should be created with the NgRx createSelector
utility function.
Reducers should be created with the NgRx createReducer
utility function.
- Note: For AOT compilation purposes, the created reducer must be wrapped in a static function (see below)
Actions:
-
filtersChanged
(event)- Parameters:
- filters:
EventFilter
- filters:
- Parameters:
-
sortChanged
: (event)- Parameters:
- sort:
ListSort
- sort:
- Parameters:
-
formatChanged
: (event)- Parameters:
- format:
ListFormat
- format:
- Parameters:
-
mapLayersChanged
: (event)- Parameters:
- layers:
MapLayers
- layers:
- Parameters:
-
timeZoneChanged
: (event)- Parameters:
- timeZone:
TimeZone
- timeZone:
- Parameters:
State Interface:
- Should be mapped in app state interface in state/index.ts
- Name:
ISettingsState
- Properties:
- settings:
Settings
- Optional
- settings:
Reducer:
- Should handle the action defined above
- Should be mapped into reducer map in state/index.ts
- Must be wrapped in an AOT compatible function named for the state (see State: Events)
Selectors:
- autoUpdate: Retrieve
autoUpdate
flag from state - currentFilters: Retrieve
filter
from state - currentSort: Retrieve
listSort
from state - currentFormat: Retrieve
listFormat
from state - currentMapLayers: Retrieve
mapLayers
from state - currentTimeZone: Retrieve
timeZone
from state
Edited by Jon Rista