svelte 5.40.2 → 5.41.1
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/compiler/index.js +1 -1
- package/package.json +1 -1
- package/src/compiler/errors.js +11 -2
- package/src/compiler/phases/2-analyze/visitors/CallExpression.js +7 -0
- package/src/compiler/phases/2-analyze/visitors/EachBlock.js +5 -0
- package/src/compiler/phases/3-transform/client/transform-client.js +4 -1
- package/src/compiler/phases/3-transform/client/visitors/CallExpression.js +6 -0
- package/src/compiler/phases/3-transform/client/visitors/Fragment.js +7 -2
- package/src/compiler/phases/3-transform/client/visitors/LetDirective.js +21 -17
- package/src/compiler/phases/3-transform/client/visitors/RegularElement.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/SlotElement.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/SvelteFragment.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/shared/component.js +2 -2
- package/src/compiler/phases/3-transform/server/visitors/CallExpression.js +4 -0
- package/src/internal/client/dom/blocks/await.js +71 -137
- package/src/internal/client/dom/blocks/boundary.js +7 -19
- package/src/internal/client/dom/blocks/branches.js +185 -0
- package/src/internal/client/dom/blocks/if.js +28 -107
- package/src/internal/client/dom/blocks/key.js +12 -58
- package/src/internal/client/dom/blocks/snippet.js +6 -22
- package/src/internal/client/dom/blocks/svelte-component.js +7 -63
- package/src/internal/client/dom/blocks/svelte-element.js +34 -45
- package/src/internal/client/dom/elements/bindings/select.js +21 -0
- package/src/internal/client/index.js +1 -1
- package/src/internal/client/reactivity/async.js +24 -8
- package/src/internal/client/reactivity/batch.js +66 -24
- package/src/internal/client/reactivity/effects.js +20 -2
- package/src/utils.js +1 -0
- package/src/version.js +1 -1
- package/types/index.d.ts +12 -0
- package/types/index.d.ts.map +1 -1
|
@@ -8,13 +8,7 @@ import {
|
|
|
8
8
|
set_hydrating
|
|
9
9
|
} from '../hydration.js';
|
|
10
10
|
import { create_text, get_first_child } from '../operations.js';
|
|
11
|
-
import {
|
|
12
|
-
block,
|
|
13
|
-
branch,
|
|
14
|
-
destroy_effect,
|
|
15
|
-
pause_effect,
|
|
16
|
-
resume_effect
|
|
17
|
-
} from '../../reactivity/effects.js';
|
|
11
|
+
import { block, teardown } from '../../reactivity/effects.js';
|
|
18
12
|
import { set_should_intro } from '../../render.js';
|
|
19
13
|
import { current_each_item, set_current_each_item } from './each.js';
|
|
20
14
|
import { active_effect } from '../../runtime.js';
|
|
@@ -23,6 +17,7 @@ import { DEV } from 'esm-env';
|
|
|
23
17
|
import { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';
|
|
24
18
|
import { assign_nodes } from '../template.js';
|
|
25
19
|
import { is_raw_text_element } from '../../../../utils.js';
|
|
20
|
+
import { BranchManager } from './branches.js';
|
|
26
21
|
|
|
27
22
|
/**
|
|
28
23
|
* @param {Comment | Element} node
|
|
@@ -42,12 +37,6 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
42
37
|
|
|
43
38
|
var filename = DEV && location && component_context?.function[FILENAME];
|
|
44
39
|
|
|
45
|
-
/** @type {string | null} */
|
|
46
|
-
var tag;
|
|
47
|
-
|
|
48
|
-
/** @type {string | null} */
|
|
49
|
-
var current_tag;
|
|
50
|
-
|
|
51
40
|
/** @type {null | Element} */
|
|
52
41
|
var element = null;
|
|
53
42
|
|
|
@@ -58,9 +47,6 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
58
47
|
|
|
59
48
|
var anchor = /** @type {TemplateNode} */ (hydrating ? hydrate_node : node);
|
|
60
49
|
|
|
61
|
-
/** @type {Effect | null} */
|
|
62
|
-
var effect;
|
|
63
|
-
|
|
64
50
|
/**
|
|
65
51
|
* The keyed `{#each ...}` item block, if any, that this element is inside.
|
|
66
52
|
* We track this so we can set it when changing the element, allowing any
|
|
@@ -68,36 +54,24 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
68
54
|
*/
|
|
69
55
|
var each_item_block = current_each_item;
|
|
70
56
|
|
|
57
|
+
var branches = new BranchManager(anchor, false);
|
|
58
|
+
|
|
71
59
|
block(() => {
|
|
72
60
|
const next_tag = get_tag() || null;
|
|
73
61
|
var ns = get_namespace ? get_namespace() : is_svg || next_tag === 'svg' ? NAMESPACE_SVG : null;
|
|
74
62
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var previous_each_item = current_each_item;
|
|
80
|
-
set_current_each_item(each_item_block);
|
|
81
|
-
|
|
82
|
-
if (effect) {
|
|
83
|
-
if (next_tag === null) {
|
|
84
|
-
// start outro
|
|
85
|
-
pause_effect(effect, () => {
|
|
86
|
-
effect = null;
|
|
87
|
-
current_tag = null;
|
|
88
|
-
});
|
|
89
|
-
} else if (next_tag === current_tag) {
|
|
90
|
-
// same tag as is currently rendered — abort outro
|
|
91
|
-
resume_effect(effect);
|
|
92
|
-
} else {
|
|
93
|
-
// tag is changing — destroy immediately, render contents without intro transitions
|
|
94
|
-
destroy_effect(effect);
|
|
95
|
-
set_should_intro(false);
|
|
96
|
-
}
|
|
63
|
+
if (next_tag === null) {
|
|
64
|
+
branches.ensure(null, null);
|
|
65
|
+
set_should_intro(true);
|
|
66
|
+
return;
|
|
97
67
|
}
|
|
98
68
|
|
|
99
|
-
|
|
100
|
-
|
|
69
|
+
branches.ensure(next_tag, (anchor) => {
|
|
70
|
+
// See explanation of `each_item_block` above
|
|
71
|
+
var previous_each_item = current_each_item;
|
|
72
|
+
set_current_each_item(each_item_block);
|
|
73
|
+
|
|
74
|
+
if (next_tag) {
|
|
101
75
|
element = hydrating
|
|
102
76
|
? /** @type {Element} */ (element)
|
|
103
77
|
: ns
|
|
@@ -149,16 +123,31 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
149
123
|
/** @type {Effect} */ (active_effect).nodes_end = element;
|
|
150
124
|
|
|
151
125
|
anchor.before(element);
|
|
152
|
-
}
|
|
153
|
-
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
set_current_each_item(previous_each_item);
|
|
129
|
+
|
|
130
|
+
if (hydrating) {
|
|
131
|
+
set_hydrate_node(anchor);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
154
134
|
|
|
155
|
-
|
|
156
|
-
if (tag) current_tag = tag;
|
|
135
|
+
// revert to the default state after the effect has been created
|
|
157
136
|
set_should_intro(true);
|
|
158
137
|
|
|
159
|
-
|
|
138
|
+
return () => {
|
|
139
|
+
if (next_tag) {
|
|
140
|
+
// if we're in this callback because we're re-running the effect,
|
|
141
|
+
// disable intros (unless no element is currently displayed)
|
|
142
|
+
set_should_intro(false);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
160
145
|
}, EFFECT_TRANSPARENT);
|
|
161
146
|
|
|
147
|
+
teardown(() => {
|
|
148
|
+
set_should_intro(true);
|
|
149
|
+
});
|
|
150
|
+
|
|
162
151
|
if (was_hydrating) {
|
|
163
152
|
set_hydrating(true);
|
|
164
153
|
set_hydrate_node(anchor);
|
|
@@ -3,6 +3,7 @@ import { listen_to_event_and_reset_event } from './shared.js';
|
|
|
3
3
|
import { is } from '../../../proxy.js';
|
|
4
4
|
import { is_array } from '../../../../shared/utils.js';
|
|
5
5
|
import * as w from '../../../warnings.js';
|
|
6
|
+
import { Batch, current_batch, previous_batch } from '../../../reactivity/batch.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Selects the correct option(s) (depending on whether this is a multiple select)
|
|
@@ -83,6 +84,7 @@ export function init_select(select) {
|
|
|
83
84
|
* @returns {void}
|
|
84
85
|
*/
|
|
85
86
|
export function bind_select_value(select, get, set = get) {
|
|
87
|
+
var batches = new WeakSet();
|
|
86
88
|
var mounting = true;
|
|
87
89
|
|
|
88
90
|
listen_to_event_and_reset_event(select, 'change', (is_reset) => {
|
|
@@ -102,11 +104,30 @@ export function bind_select_value(select, get, set = get) {
|
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
set(value);
|
|
107
|
+
|
|
108
|
+
if (current_batch !== null) {
|
|
109
|
+
batches.add(current_batch);
|
|
110
|
+
}
|
|
105
111
|
});
|
|
106
112
|
|
|
107
113
|
// Needs to be an effect, not a render_effect, so that in case of each loops the logic runs after the each block has updated
|
|
108
114
|
effect(() => {
|
|
109
115
|
var value = get();
|
|
116
|
+
|
|
117
|
+
if (select === document.activeElement) {
|
|
118
|
+
// we need both, because in non-async mode, render effects run before previous_batch is set
|
|
119
|
+
var batch = /** @type {Batch} */ (previous_batch ?? current_batch);
|
|
120
|
+
|
|
121
|
+
// Don't update the <select> if it is focused. We can get here if, for example,
|
|
122
|
+
// an update is deferred because of async work depending on the select:
|
|
123
|
+
//
|
|
124
|
+
// <select bind:value={selected}>...</select>
|
|
125
|
+
// <p>{await find(selected)}</p>
|
|
126
|
+
if (batches.has(batch)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
110
131
|
select_option(select, value, mounting);
|
|
111
132
|
|
|
112
133
|
// Mounting and value undefined -> take selection from dom
|
|
@@ -103,7 +103,7 @@ export {
|
|
|
103
103
|
save,
|
|
104
104
|
track_reactivity_loss
|
|
105
105
|
} from './reactivity/async.js';
|
|
106
|
-
export { flushSync as flush } from './reactivity/batch.js';
|
|
106
|
+
export { eager, flushSync as flush } from './reactivity/batch.js';
|
|
107
107
|
export {
|
|
108
108
|
async_derived,
|
|
109
109
|
user_derived as derived,
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/** @import { Effect, Value } from '#client' */
|
|
2
|
-
|
|
1
|
+
/** @import { Effect, TemplateNode, Value } from '#client' */
|
|
3
2
|
import { DESTROYED } from '#client/constants';
|
|
4
3
|
import { DEV } from 'esm-env';
|
|
5
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
component_context,
|
|
6
|
+
dev_stack,
|
|
7
|
+
is_runes,
|
|
8
|
+
set_component_context,
|
|
9
|
+
set_dev_stack
|
|
10
|
+
} from '../context.js';
|
|
6
11
|
import { get_boundary } from '../dom/blocks/boundary.js';
|
|
7
12
|
import { invoke_error_boundary } from '../error-handling.js';
|
|
8
13
|
import {
|
|
@@ -28,6 +33,7 @@ import {
|
|
|
28
33
|
set_hydrating,
|
|
29
34
|
skip_nodes
|
|
30
35
|
} from '../dom/hydration.js';
|
|
36
|
+
import { create_text } from '../dom/operations.js';
|
|
31
37
|
|
|
32
38
|
/**
|
|
33
39
|
*
|
|
@@ -80,7 +86,7 @@ export function flatten(sync, async, fn) {
|
|
|
80
86
|
* some asynchronous work has happened (so that e.g. `await a + b`
|
|
81
87
|
* causes `b` to be registered as a dependency).
|
|
82
88
|
*/
|
|
83
|
-
function capture() {
|
|
89
|
+
export function capture() {
|
|
84
90
|
var previous_effect = active_effect;
|
|
85
91
|
var previous_reaction = active_reaction;
|
|
86
92
|
var previous_component_context = component_context;
|
|
@@ -92,6 +98,10 @@ function capture() {
|
|
|
92
98
|
var previous_hydrate_node = hydrate_node;
|
|
93
99
|
}
|
|
94
100
|
|
|
101
|
+
if (DEV) {
|
|
102
|
+
var previous_dev_stack = dev_stack;
|
|
103
|
+
}
|
|
104
|
+
|
|
95
105
|
return function restore() {
|
|
96
106
|
set_active_effect(previous_effect);
|
|
97
107
|
set_active_reaction(previous_reaction);
|
|
@@ -105,6 +115,7 @@ function capture() {
|
|
|
105
115
|
|
|
106
116
|
if (DEV) {
|
|
107
117
|
set_from_async_derived(null);
|
|
118
|
+
set_dev_stack(previous_dev_stack);
|
|
108
119
|
}
|
|
109
120
|
};
|
|
110
121
|
}
|
|
@@ -193,13 +204,18 @@ export function unset_context() {
|
|
|
193
204
|
set_active_effect(null);
|
|
194
205
|
set_active_reaction(null);
|
|
195
206
|
set_component_context(null);
|
|
196
|
-
|
|
207
|
+
|
|
208
|
+
if (DEV) {
|
|
209
|
+
set_from_async_derived(null);
|
|
210
|
+
set_dev_stack(null);
|
|
211
|
+
}
|
|
197
212
|
}
|
|
198
213
|
|
|
199
214
|
/**
|
|
200
|
-
* @param {
|
|
215
|
+
* @param {TemplateNode} anchor
|
|
216
|
+
* @param {(target: TemplateNode) => Promise<void>} fn
|
|
201
217
|
*/
|
|
202
|
-
export async function async_body(fn) {
|
|
218
|
+
export async function async_body(anchor, fn) {
|
|
203
219
|
var boundary = get_boundary();
|
|
204
220
|
var batch = /** @type {Batch} */ (current_batch);
|
|
205
221
|
var pending = boundary.is_pending();
|
|
@@ -218,7 +234,7 @@ export async function async_body(fn) {
|
|
|
218
234
|
}
|
|
219
235
|
|
|
220
236
|
try {
|
|
221
|
-
var promise = fn();
|
|
237
|
+
var promise = fn(anchor);
|
|
222
238
|
} finally {
|
|
223
239
|
if (next_hydrate_node) {
|
|
224
240
|
set_hydrate_node(next_hydrate_node);
|
|
@@ -17,6 +17,7 @@ import { async_mode_flag } from '../../flags/index.js';
|
|
|
17
17
|
import { deferred, define_property } from '../../shared/utils.js';
|
|
18
18
|
import {
|
|
19
19
|
active_effect,
|
|
20
|
+
get,
|
|
20
21
|
is_dirty,
|
|
21
22
|
is_updating_effect,
|
|
22
23
|
set_is_updating_effect,
|
|
@@ -27,8 +28,8 @@ import * as e from '../errors.js';
|
|
|
27
28
|
import { flush_tasks, queue_micro_task } from '../dom/task.js';
|
|
28
29
|
import { DEV } from 'esm-env';
|
|
29
30
|
import { invoke_error_boundary } from '../error-handling.js';
|
|
30
|
-
import { old_values } from './sources.js';
|
|
31
|
-
import { unlink_effect } from './effects.js';
|
|
31
|
+
import { old_values, source, update } from './sources.js';
|
|
32
|
+
import { inspect_effect, unlink_effect } from './effects.js';
|
|
32
33
|
|
|
33
34
|
/** @type {Set<Batch>} */
|
|
34
35
|
const batches = new Set();
|
|
@@ -97,13 +98,6 @@ export class Batch {
|
|
|
97
98
|
*/
|
|
98
99
|
#deferred = null;
|
|
99
100
|
|
|
100
|
-
/**
|
|
101
|
-
* Async effects inside a newly-created `<svelte:boundary>`
|
|
102
|
-
* — these do not prevent the batch from committing
|
|
103
|
-
* @type {Effect[]}
|
|
104
|
-
*/
|
|
105
|
-
#boundary_async_effects = [];
|
|
106
|
-
|
|
107
101
|
/**
|
|
108
102
|
* Template effects and `$effect.pre` effects, which run when
|
|
109
103
|
* a batch is committed
|
|
@@ -158,8 +152,7 @@ export class Batch {
|
|
|
158
152
|
this.#traverse_effect_tree(root);
|
|
159
153
|
}
|
|
160
154
|
|
|
161
|
-
// if
|
|
162
|
-
// is outstanding from a previous flush, commit
|
|
155
|
+
// if there is no outstanding async work, commit
|
|
163
156
|
if (this.#pending === 0) {
|
|
164
157
|
// TODO we need this because we commit _then_ flush effects...
|
|
165
158
|
// maybe there's a way we can reverse the order?
|
|
@@ -193,12 +186,6 @@ export class Batch {
|
|
|
193
186
|
}
|
|
194
187
|
|
|
195
188
|
batch_values = null;
|
|
196
|
-
|
|
197
|
-
for (const effect of this.#boundary_async_effects) {
|
|
198
|
-
update_effect(effect);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
this.#boundary_async_effects = [];
|
|
202
189
|
}
|
|
203
190
|
|
|
204
191
|
/**
|
|
@@ -225,13 +212,9 @@ export class Batch {
|
|
|
225
212
|
this.#effects.push(effect);
|
|
226
213
|
} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {
|
|
227
214
|
this.#render_effects.push(effect);
|
|
228
|
-
} else if ((
|
|
229
|
-
if ((
|
|
230
|
-
|
|
231
|
-
} else if (is_dirty(effect)) {
|
|
232
|
-
if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);
|
|
233
|
-
update_effect(effect);
|
|
234
|
-
}
|
|
215
|
+
} else if (is_dirty(effect)) {
|
|
216
|
+
if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);
|
|
217
|
+
update_effect(effect);
|
|
235
218
|
}
|
|
236
219
|
|
|
237
220
|
var child = effect.first;
|
|
@@ -702,6 +685,65 @@ export function schedule_effect(signal) {
|
|
|
702
685
|
queued_root_effects.push(effect);
|
|
703
686
|
}
|
|
704
687
|
|
|
688
|
+
/** @type {Source<number>[]} */
|
|
689
|
+
let eager_versions = [];
|
|
690
|
+
|
|
691
|
+
function eager_flush() {
|
|
692
|
+
try {
|
|
693
|
+
flushSync(() => {
|
|
694
|
+
for (const version of eager_versions) {
|
|
695
|
+
update(version);
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
} finally {
|
|
699
|
+
eager_versions = [];
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Implementation of `$state.eager(fn())`
|
|
705
|
+
* @template T
|
|
706
|
+
* @param {() => T} fn
|
|
707
|
+
* @returns {T}
|
|
708
|
+
*/
|
|
709
|
+
export function eager(fn) {
|
|
710
|
+
var version = source(0);
|
|
711
|
+
var initial = true;
|
|
712
|
+
var value = /** @type {T} */ (undefined);
|
|
713
|
+
|
|
714
|
+
get(version);
|
|
715
|
+
|
|
716
|
+
inspect_effect(() => {
|
|
717
|
+
if (initial) {
|
|
718
|
+
// the first time this runs, we create an inspect effect
|
|
719
|
+
// that will run eagerly whenever the expression changes
|
|
720
|
+
var previous_batch_values = batch_values;
|
|
721
|
+
|
|
722
|
+
try {
|
|
723
|
+
batch_values = null;
|
|
724
|
+
value = fn();
|
|
725
|
+
} finally {
|
|
726
|
+
batch_values = previous_batch_values;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// the second time this effect runs, it's to schedule a
|
|
733
|
+
// `version` update. since this will recreate the effect,
|
|
734
|
+
// we don't need to evaluate the expression here
|
|
735
|
+
if (eager_versions.length === 0) {
|
|
736
|
+
queue_micro_task(eager_flush);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
eager_versions.push(version);
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
initial = false;
|
|
743
|
+
|
|
744
|
+
return value;
|
|
745
|
+
}
|
|
746
|
+
|
|
705
747
|
/**
|
|
706
748
|
* Forcibly remove all current batches, to prevent cross-talk between tests
|
|
707
749
|
*/
|
|
@@ -553,15 +553,16 @@ export function unlink_effect(effect) {
|
|
|
553
553
|
* A paused effect does not update, and the DOM subtree becomes inert.
|
|
554
554
|
* @param {Effect} effect
|
|
555
555
|
* @param {() => void} [callback]
|
|
556
|
+
* @param {boolean} [destroy]
|
|
556
557
|
*/
|
|
557
|
-
export function pause_effect(effect, callback) {
|
|
558
|
+
export function pause_effect(effect, callback, destroy = true) {
|
|
558
559
|
/** @type {TransitionManager[]} */
|
|
559
560
|
var transitions = [];
|
|
560
561
|
|
|
561
562
|
pause_children(effect, transitions, true);
|
|
562
563
|
|
|
563
564
|
run_out_transitions(transitions, () => {
|
|
564
|
-
destroy_effect(effect);
|
|
565
|
+
if (destroy) destroy_effect(effect);
|
|
565
566
|
if (callback) callback();
|
|
566
567
|
});
|
|
567
568
|
}
|
|
@@ -662,3 +663,20 @@ function resume_children(effect, local) {
|
|
|
662
663
|
export function aborted(effect = /** @type {Effect} */ (active_effect)) {
|
|
663
664
|
return (effect.f & DESTROYED) !== 0;
|
|
664
665
|
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @param {Effect} effect
|
|
669
|
+
* @param {DocumentFragment} fragment
|
|
670
|
+
*/
|
|
671
|
+
export function move_effect(effect, fragment) {
|
|
672
|
+
var node = effect.nodes_start;
|
|
673
|
+
var end = effect.nodes_end;
|
|
674
|
+
|
|
675
|
+
while (node !== null) {
|
|
676
|
+
/** @type {TemplateNode | null} */
|
|
677
|
+
var next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));
|
|
678
|
+
|
|
679
|
+
fragment.append(node);
|
|
680
|
+
node = next;
|
|
681
|
+
}
|
|
682
|
+
}
|
package/src/utils.js
CHANGED
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -3193,6 +3193,18 @@ declare namespace $state {
|
|
|
3193
3193
|
: never
|
|
3194
3194
|
: never;
|
|
3195
3195
|
|
|
3196
|
+
/**
|
|
3197
|
+
* Returns the latest `value`, even if the rest of the UI is suspending
|
|
3198
|
+
* while async work (such as data loading) completes.
|
|
3199
|
+
*
|
|
3200
|
+
* ```svelte
|
|
3201
|
+
* <nav>
|
|
3202
|
+
* <a href="/" aria-current={$state.eager(pathname) === '/' ? 'page' : null}>home</a>
|
|
3203
|
+
* <a href="/about" aria-current={$state.eager(pathname) === '/about' ? 'page' : null}>about</a>
|
|
3204
|
+
* </nav>
|
|
3205
|
+
* ```
|
|
3206
|
+
*/
|
|
3207
|
+
export function eager<T>(value: T): T;
|
|
3196
3208
|
/**
|
|
3197
3209
|
* Declares state that is _not_ made deeply reactive — instead of mutating it,
|
|
3198
3210
|
* you must reassign it.
|
package/types/index.d.ts.map
CHANGED
|
@@ -261,6 +261,6 @@
|
|
|
261
261
|
null,
|
|
262
262
|
null
|
|
263
263
|
],
|
|
264
|
-
"mappings": ";;;;;;;kBAUiBA,2BAA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkC/BC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAwEhBC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;kBAwBbC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCbC,oBAAoBA;;;;;;;;;;;;;;;;;;;;;;;;aAwBrBC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCfC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6BdC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;kBAuBRC,OAAOA;;;;;;;;;;;;;;;;kBAgBPC,eAAeA;;;;;;;;;;;;;;;;aAgBpBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCzPRC,cAAcA;;;;;;;;;;;;iBAsBdC,OAAOA;;;;;;;;iBAwBPC,SAASA;;;;;;;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