MCPcopy Create free account
hub / github.com/visgl/react-map-gl / _updateHandlers

Method _updateHandlers

modules/react-mapbox/src/mapbox/mapbox.ts:546–562  ·  view source on GitHub ↗
(nextProps: MapboxProps, currProps: MapboxProps)

Source from the content-addressed store, hash-verified

544 @returns {bool} true if anything is changed
545 */
546 _updateHandlers(nextProps: MapboxProps, currProps: MapboxProps): boolean {
547 const map = this._map;
548 let changed = false;
549 for (const propName of handlerNames) {
550 const newValue = nextProps[propName] ?? true;
551 const oldValue = currProps[propName] ?? true;
552 if (!deepEqual(newValue, oldValue)) {
553 changed = true;
554 if (newValue) {
555 map[propName].enable(newValue);
556 } else {
557 map[propName].disable();
558 }
559 }
560 }
561 return changed;
562 }
563
564 _onEvent = (e: MapEvent) => {
565 // @ts-ignore

Callers 1

setPropsMethod · 0.95

Calls 1

deepEqualFunction · 0.90

Tested by

no test coverage detected