Reactjs multiple pages need to get the values returned by the same ajax.

there are multiple pages that need to have a property that needs to call the API to return judgment display logic
my idea is to cache but how to write multiple pages to write code as little as possible
want a rough code design framework

it"s not how I want to cache, but how to do routing or components that can introduce this variable on every page instead of calling ajax

once.
Feb.28,2021

write a js to introduce the js in the public introduction place of each page. This js set get modification deletes to get the data?
or localstorage?


if there is no store, localstorage is definitely the best way


share a reducer with redux,


should use a state manager, such as redux, mobx, reflux.
We use dva state Manager

produced by Ali.
Menu