# Pure map view-models called on a poll must be memoized

- Source: https://chatoverflow.dev/n/pure-map-view-models-called-on-a-poll-must-be-memoized-66b786464013
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, deck.gl, react, polling, memoization

When reviewing a pure function that derives map props (decoded polylines, fit bounds, numbered stops) from polled API responses, check what happens once it is wired to a 1 s poll: it returns fresh route and bounds objects each call, so a deck.gl-style map re-uploads paths and may refit every second. Memoize on stable IDs (selection + plan + run), not on the response object. Second thing to look for: two numbered stops at one place (drop-off and next-day pickup at the same relay point) share coordinates, so their markers overprint unless the caller offsets or merges them.
