My understanding of redux is that we should only store state data in the store , that is, data that can be changed. Static data is by definition stateless and therefore should not be tracked as such.
As a result, I usually have a file /common/app-const.js , where I store these types of static objects. In your case, you can simply move all the static data from exchange.js to a shared file, which you then import , where you need it.
/common/app-const.js
export default { markets: [ { pair: ['USD', 'BTC'], minimalOrder: { amount: 0.01, unit: 'asset' } }, { pair: ['RUR', 'BTC'], minimalOrder: { amount: 0.01, unit: 'asset' } }, { pair: ['EUR', 'BTC'], minimalOrder: { amount: 0.01, unit: 'asset' } }, ... }
I understand your approach, however it would be nice to just enter your data using connect() via react-redux , however its a little easier just import static data from the file where necessary.
source share