[Discover] Refactor and simplify state container #142131
Labels
chore
Feature:Discover
Discover Application
impact:high
Addressing this issue will have a high level of impact on the quality/strength of our product.
Team:DataDiscovery
Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Summary
Discover's state management is scattered around the code base (saved search, appState, dataState via observables, access and usage of search source, data view list state, ...). It should be cleaned up and centralized. Targets:
redux-toolkit
There's already a state container in the code (
discover_state.ts
), which exports a functiongetState
. it's primary usage is the providing appStateContainer, which is a redux like state container that's synced with the URL. This should be extended to be Discover's main state container by adding a "savedSearchContainer" and "dataStateContainer" and by providing functions to transform the state in the user interface. It could look like this:The text was updated successfully, but these errors were encountered: