(layer: E, props: P, prevProps: P)
| 1 | import type { GridLayer, GridLayerOptions } from 'leaflet' |
| 2 | |
| 3 | export function updateGridLayer< |
| 4 | E extends GridLayer, |
| 5 | P extends GridLayerOptions, |
| 6 | >(layer: E, props: P, prevProps: P) { |
| 7 | const { opacity, zIndex } = props |
| 8 | if (opacity != null && opacity !== prevProps.opacity) { |
| 9 | layer.setOpacity(opacity) |
| 10 | } |
| 11 | if (zIndex != null && zIndex !== prevProps.zIndex) { |
| 12 | layer.setZIndex(zIndex) |
| 13 | } |
| 14 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…