Open efreeti opened 3 years ago
Pinging @elastic/endpoint-management (Team:Endpoint Management)
I'm ok with this refactoring. Personally, I find the duplication in this case cleaner and code clearer to read than to crawl all of the generic types - but that is a personal preference.
The AsyncResourceState (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/async_resource_state.ts#L85) data structure was specifically designed for the purposes to represent async communication with remote server (whether you get data or post/put/delete data). It was used in all parts of trusted apps store except create request (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/trusted_apps_list_page_state.ts#L63). The data structures used for that seem to be of the same shape, so duplication seems to be redundant here. It would also be good to be consistent in this aspect.