-
Notifications
You must be signed in to change notification settings - Fork 9
use:svelteTime 的 action 会丢失对传入参数的响应性 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, can you try the following:
<script>
import { svelteTime } from 'svelte-time';
let data = $state({
timestamp: '2021-02-02',
format: 'dddd @ h:mm A · MMMM D, YYYY'
});
setTimeout(() => {
data.timestamp = '2025-04-02'
}, 3000);
</script>
<time use:svelteTime={data}></time>
|
Thanks. Yes, it's possible. But is there a solution to raw? |
Another way is to adjust the incoming data into a function and obtain the result through the function.
|
I'll take a look at supporting the |
Or can consider mixing svelte4 and svelte5.
Bu it doesn't seem to be the best way. |
I used a relatively elegant way of writing, guaranteeing that the external parameters remain unchanged, and the internal use `() => data 'fetch. We can create a createEnhanceAction method, encapsulate the update internally, and discard the middle layer after svelte5 does new support.
|
In svelteAction svelteTime, if the object is a state, state lost its reactivity, unlinke update in svelte4.
e.g.
The text was updated successfully, but these errors were encountered: