Hacker News new | ask | show | jobs
by t1mmen 2648 days ago
We started using ~this selector pattern for timelyapp.com almost two years ago, and have found it tremendously helpful.

Anytime we’re reading data from Redux, it’s via a selector (usually a composition of multiple selectors).

For data fetching, we use a slightly different approach, but same principle: An xhrCacheBuster string that, when changed, fires a thunk action. Query params/payload is determined via a selector in the thunk.

We use similar patterns to “sign” expensive-to-render things, then compare the renderCacheBuster string in shouldComponentUpdate. Same with virtualized lists (named virtualizationCacheBuster)