I'm building a chart component that needs an array of ranges, something like
[{min: 0, max: 9}, {min: 10, max: 29}, {min: 30, max: 49}]
I'm getting this data from a service in the backend. I thought about creating a hook useRanges() that will make the request to the backend, store the result in its state and the return it.
The thing is that since this data won't change, like never, I can't be making more than one request to the backend. Otherwise that could lead to perfoemance issues.
Am I able to create some variable that could be shared among the instances of this hook?