@@ -77,7 +77,7 @@ export function spring(value, opts = {}) {
77
77
* @param {import('./private').SpringUpdateOpts } opts
78
78
* @returns {Promise<void> }
79
79
*/
80
- function set ( new_value , opts = { } ) {
80
+ async function set ( new_value , opts = { } ) {
81
81
target_value = new_value ;
82
82
const token = ( current_token = { } ) ;
83
83
if ( value == null || opts . hard || ( spring . stiffness >= 1 && spring . damping >= 1 ) ) {
@@ -120,20 +120,17 @@ export function spring(value, opts = {}) {
120
120
} ) ;
121
121
}
122
122
return new Promise ( ( fulfil ) => {
123
- /** @type {import('../internal/client/types').Task } */ ( task ) . promise
124
- . then ( ( ) => {
125
- if ( token === current_token ) fulfil ( ) ;
126
- } )
127
- . catch ( ( err ) => {
128
- // eslint-disable-next-line no-console
129
- console . error ( err ) ;
130
- } ) ;
123
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
124
+ /** @type {import('../internal/client/types').Task } */ ( task ) . promise . then ( ( ) => {
125
+ if ( token === current_token ) fulfil ( ) ;
126
+ } ) ;
131
127
} ) ;
132
128
}
133
129
/** @type {import('./public.js').Spring<T> } */
134
130
const spring = {
135
131
set,
136
- update : ( fn , opts ) => set ( fn ( /** @type {T } */ ( target_value ) , /** @type {T } */ ( value ) ) , opts ) ,
132
+ update : async ( fn , opts ) =>
133
+ set ( fn ( /** @type {T } */ ( target_value ) , /** @type {T } */ ( value ) ) , opts ) ,
137
134
subscribe : store . subscribe ,
138
135
stiffness,
139
136
damping,
0 commit comments