MCPcopy Create free account
hub / github.com/facebook/Rapid / revalidate

Method revalidate

modules/core/ValidationSystem.js:215–230  ·  view source on GitHub ↗
(cache)

Source from the content-addressed store, hash-verified

213 if (typeof checkUnsquareWay !== 'function') return;
214
215 const revalidate = (cache) => {
216 if (!cache.graph) return;
217
218 cache.uncacheIssuesOfType('unsquare_way'); // uncache existing
219
220 // rerun for all buildings
221 const tree = this.context.systems.editor.tree;
222 const buildings = tree.intersects(new Extent([-180,-90],[180, 90]), cache.graph) // everywhere
223 .filter(entity => (entity.type === 'way' && entity.tags.building && entity.tags.building !== 'no'));
224
225 for (const entity of buildings) {
226 const detected = checkUnsquareWay(entity, cache.graph);
227 if (!detected.length) continue;
228 cache.cacheIssues(detected);
229 }
230 };
231
232 revalidate(this._head);
233 revalidate(this._base);

Callers

nothing calls this directly

Calls 4

uncacheIssuesOfTypeMethod · 0.80
filterMethod · 0.80
cacheIssuesMethod · 0.80
intersectsMethod · 0.45

Tested by

no test coverage detected