@dryui/primitives 0.1.10 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import { getMapCtx, setMarkerCtx } from './context.svelte.js';
4
- import { onDestroy } from 'svelte';
4
+ import { onDestroy, untrack } from 'svelte';
5
5
  import type { LngLat, MapMarkerInstance, MarkerOptions } from './types.js';
6
6
 
7
7
  interface Props {
@@ -30,10 +30,10 @@
30
30
  $effect(() => {
31
31
  if (!ctx.loaded || !ctx.map || !ctx.lib) return;
32
32
 
33
- // Remove previous marker if it exists
34
- if (markerInstance) {
35
- markerInstance.remove();
36
- markerInstance = null;
33
+ // Remove previous marker without tracking markerInstance as a dependency
34
+ const prev = untrack(() => markerInstance);
35
+ if (prev) {
36
+ prev.remove();
37
37
  }
38
38
 
39
39
  const opts: MarkerOptions = {};
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import { getMapCtx, getMarkerCtx } from './context.svelte.js';
4
- import { onDestroy } from 'svelte';
4
+ import { onDestroy, untrack } from 'svelte';
5
5
  import type { MapPopupInstance } from './types.js';
6
6
 
7
7
  interface Props {
@@ -29,10 +29,10 @@
29
29
  $effect(() => {
30
30
  if (!mapCtx.loaded || !mapCtx.map || !mapCtx.lib || !markerCtx.marker || !contentEl) return;
31
31
 
32
- // Remove previous popup
33
- if (popupInstance) {
34
- popupInstance.remove();
35
- popupInstance = null;
32
+ // Remove previous popup without tracking popupInstance as a dependency
33
+ const prev = untrack(() => popupInstance);
34
+ if (prev) {
35
+ prev.remove();
36
36
  }
37
37
 
38
38
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dryui/primitives",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "author": "Rob Balfre",
5
5
  "license": "MIT",
6
6
  "repository": {