Skip to content

Commit 86b06cb

Browse files
authored
chore: dry out transition get_options (#16329)
1 parent 71ed9e4 commit 86b06cb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

packages/svelte/src/internal/client/dom/elements/transitions.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,21 +209,14 @@ export function transition(flags, element, get_fn, get_params) {
209209
var outro;
210210

211211
function get_options() {
212-
var previous_reaction = active_reaction;
213-
var previous_effect = active_effect;
214-
set_active_reaction(null);
215-
set_active_effect(null);
216-
try {
212+
return without_reactive_context(() => {
217213
// If a transition is still ongoing, we use the existing options rather than generating
218214
// new ones. This ensures that reversible transitions reverse smoothly, rather than
219215
// jumping to a new spot because (for example) a different `duration` was used
220216
return (current_options ??= get_fn()(element, get_params?.() ?? /** @type {P} */ ({}), {
221217
direction
222218
}));
223-
} finally {
224-
set_active_reaction(previous_reaction);
225-
set_active_effect(previous_effect);
226-
}
219+
});
227220
}
228221

229222
/** @type {TransitionManager} */

0 commit comments

Comments
 (0)