Skip to content

Commit 474f3d7

Browse files
committed
remove redundant asyncs
1 parent 0611bef commit 474f3d7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/svelte/src/compiler/preprocess/replace_in_code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function slice_source(code_slice, offset, { file_basename, filename, get_
2020
* @param {(...match: any[]) => Promise<MappedCode>} get_replacement
2121
* @param {string} source
2222
*/
23-
async function calculate_replacements(re, get_replacement, source) {
23+
function calculate_replacements(re, get_replacement, source) {
2424
/**
2525
* @type {Array<Promise<import('./private.js').Replacement>>}
2626
*/

packages/svelte/src/motion/spring.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function spring(value, opts = {}) {
7777
* @param {import('./private').SpringUpdateOpts} opts
7878
* @returns {Promise<void>}
7979
*/
80-
async function set(new_value, opts = {}) {
80+
function set(new_value, opts = {}) {
8181
target_value = new_value;
8282
const token = (current_token = {});
8383
if (value == null || opts.hard || (spring.stiffness >= 1 && spring.damping >= 1)) {
@@ -129,8 +129,7 @@ export function spring(value, opts = {}) {
129129
/** @type {import('./public.js').Spring<T>} */
130130
const spring = {
131131
set,
132-
update: async (fn, opts) =>
133-
set(fn(/** @type {T} */ (target_value), /** @type {T} */ (value)), opts),
132+
update: (fn, opts) => set(fn(/** @type {T} */ (target_value), /** @type {T} */ (value)), opts),
134133
subscribe: store.subscribe,
135134
stiffness,
136135
damping,

packages/svelte/src/motion/tweened.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function tweened(value, defaults = {}) {
8888
* @param {T} new_value
8989
* @param {import('./private').TweenedOptions<T>} [opts]
9090
*/
91-
async function set(new_value, opts) {
91+
function set(new_value, opts) {
9292
target_value = new_value;
9393

9494
if (value == null) {
@@ -145,7 +145,7 @@ export function tweened(value, defaults = {}) {
145145
}
146146
return {
147147
set,
148-
update: async (fn, opts) =>
148+
update: (fn, opts) =>
149149
set(fn(/** @type {any} */ (target_value), /** @type {any} */ (value)), opts),
150150
subscribe: store.subscribe
151151
};

0 commit comments

Comments
 (0)