Skip to content

set initial loading state from options fields#341

Merged
TGlide merged 2 commits intosvecosystem:mainfrom
aevstratov:feat/initial-loading-from-params
Dec 20, 2025
Merged

set initial loading state from options fields#341
TGlide merged 2 commits intosvecosystem:mainfrom
aevstratov:feat/initial-loading-from-params

Conversation

@aevstratov
Copy link
Contributor

Recently i ran into an issue with displaying a table with resource data. I do basic flow in markup like: {#if someResource.loading}...{:else if someResource.error}...{:else}<!-- working with resource data -->{/if}. And when i try to display date like <td>{formatter.format(someResource.current!.user.created_at)}</td>, i get an error saying that i am trying to display data that is undefined. After some time of debugging i found line with loading definition that is just let loading = $state(false). So this is the reason i got that error. It first tries to render block that i assume has a valid data, then starts handling loaderFn. I think it would be nice to set initial loading state that depends on params (check whether params have initial data or not + check "lazy" field).

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2025

🦋 Changeset detected

Latest commit: f9f7d36

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
runed Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@huntabyte huntabyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
runed ❌ Failed (View Log) f9f7d36

@github-actions github-actions bot requested a deployment to Preview November 7, 2025 00:26 Abandoned
@TGlide TGlide merged commit ff06b37 into svecosystem:main Dec 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants