create-quadrokit 0.2.10 → 0.2.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-quadrokit",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Scaffold a QuadroKit Vite + React app from a template",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.mjs",
@@ -11,6 +11,7 @@ export function AgenciesPage() {
11
11
 
12
12
  useEffect(() => {
13
13
  const seq = ++loadSeq.current
14
+ const ac = new AbortController()
14
15
  let cancelled = false
15
16
  ;(async () => {
16
17
  try {
@@ -19,6 +20,7 @@ export function AgenciesPage() {
19
20
  pageSize: PAGE_SIZE,
20
21
  select: ['name'],
21
22
  maxItems: PAGE_SIZE,
23
+ signal: ac.signal,
22
24
  })
23
25
  const acc: string[] = []
24
26
  for await (const a of list) {
@@ -31,6 +33,9 @@ export function AgenciesPage() {
31
33
  setNames(acc)
32
34
  }
33
35
  } catch (e) {
36
+ if (e instanceof Error && e.name === 'AbortError') {
37
+ return
38
+ }
34
39
  if (!cancelled && seq === loadSeq.current) {
35
40
  setError(e instanceof Error ? e.message : String(e))
36
41
  }
@@ -38,6 +43,7 @@ export function AgenciesPage() {
38
43
  })()
39
44
  return () => {
40
45
  cancelled = true
46
+ ac.abort()
41
47
  }
42
48
  }, [])
43
49
 
@@ -11,6 +11,7 @@ export function AgenciesPage() {
11
11
 
12
12
  useEffect(() => {
13
13
  const seq = ++loadSeq.current
14
+ const ac = new AbortController()
14
15
  let cancelled = false
15
16
  ;(async () => {
16
17
  try {
@@ -19,6 +20,7 @@ export function AgenciesPage() {
19
20
  pageSize: PAGE_SIZE,
20
21
  select: ['name'],
21
22
  maxItems: PAGE_SIZE,
23
+ signal: ac.signal,
22
24
  })
23
25
  const acc: string[] = []
24
26
  for await (const a of list) {
@@ -31,6 +33,9 @@ export function AgenciesPage() {
31
33
  setNames(acc)
32
34
  }
33
35
  } catch (e) {
36
+ if (e instanceof Error && e.name === 'AbortError') {
37
+ return
38
+ }
34
39
  if (!cancelled && seq === loadSeq.current) {
35
40
  setError(e instanceof Error ? e.message : String(e))
36
41
  }
@@ -38,6 +43,7 @@ export function AgenciesPage() {
38
43
  })()
39
44
  return () => {
40
45
  cancelled = true
46
+ ac.abort()
41
47
  }
42
48
  }, [])
43
49
 
@@ -11,6 +11,7 @@ export function AgenciesPage() {
11
11
 
12
12
  useEffect(() => {
13
13
  const seq = ++loadSeq.current
14
+ const ac = new AbortController()
14
15
  let cancelled = false
15
16
  ;(async () => {
16
17
  try {
@@ -19,6 +20,7 @@ export function AgenciesPage() {
19
20
  pageSize: PAGE_SIZE,
20
21
  select: ['name'],
21
22
  maxItems: PAGE_SIZE,
23
+ signal: ac.signal,
22
24
  })
23
25
  const acc: string[] = []
24
26
  for await (const a of list) {
@@ -31,6 +33,9 @@ export function AgenciesPage() {
31
33
  setNames(acc)
32
34
  }
33
35
  } catch (e) {
36
+ if (e instanceof Error && e.name === 'AbortError') {
37
+ return
38
+ }
34
39
  if (!cancelled && seq === loadSeq.current) {
35
40
  setError(e instanceof Error ? e.message : String(e))
36
41
  }
@@ -38,6 +43,7 @@ export function AgenciesPage() {
38
43
  })()
39
44
  return () => {
40
45
  cancelled = true
46
+ ac.abort()
41
47
  }
42
48
  }, [])
43
49
 
@@ -11,6 +11,7 @@ export function AgenciesPage() {
11
11
 
12
12
  useEffect(() => {
13
13
  const seq = ++loadSeq.current
14
+ const ac = new AbortController()
14
15
  let cancelled = false
15
16
  ;(async () => {
16
17
  try {
@@ -19,6 +20,7 @@ export function AgenciesPage() {
19
20
  pageSize: PAGE_SIZE,
20
21
  select: ['name'],
21
22
  maxItems: PAGE_SIZE,
23
+ signal: ac.signal,
22
24
  })
23
25
  const acc: string[] = []
24
26
  for await (const a of list) {
@@ -31,6 +33,9 @@ export function AgenciesPage() {
31
33
  setNames(acc)
32
34
  }
33
35
  } catch (e) {
36
+ if (e instanceof Error && e.name === 'AbortError') {
37
+ return
38
+ }
34
39
  if (!cancelled && seq === loadSeq.current) {
35
40
  setError(e instanceof Error ? e.message : String(e))
36
41
  }
@@ -38,6 +43,7 @@ export function AgenciesPage() {
38
43
  })()
39
44
  return () => {
40
45
  cancelled = true
46
+ ac.abort()
41
47
  }
42
48
  }, [])
43
49