Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

useDeno content doesn't update #189

Unanswered
lcswillems asked this question in Q&A
Discussion options

For example, if I put this in a component:

const date = useDeno(async () => {
 const res = await fetch(
 "http://worldtimeapi.org/api/timezone/Europe/London.txt"
 );
 return res.text();
});

The date is always the same when I refresh the page. Deno seems to cache the value but this is unexpected behavior for server-side rendering.

You must be logged in to vote

Replies: 2 comments

Comment options

The factory function is only executed on initial build, not on every refresh

You can pass "true" to the useDeno hook to fetch client-side on each refresh

https://alephjs.org/docs/advanced-features/use-deno-hook

You must be logged in to vote
0 replies
Comment options

Okay thank you!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #188 on March 12, 2021 16:25.

AltStyle によって変換されたページ (->オリジナル) /