Skip to content
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

store property inaccessible by another XElement #9

Open
paulrudy opened this issue Aug 23, 2022 · 0 comments
Open

store property inaccessible by another XElement #9

paulrudy opened this issue Aug 23, 2022 · 0 comments

Comments

@paulrudy
Copy link

Is this expected behavior? In one Astro component I have

<XElement.div
  @do={(element,store)=>{
    store.foo = 'bar';
  }}
>
</Xelement.div>

and in another I have

<XElement.div
  @do={(element,store)=>{
    console.log(store.foo); // 'undefined'
    setTimeout(() => console.log(store.foo), 1); // 'bar'
  }}
>
</Xelement.div>

Apparently there needs to be a delay of even 1 ms to be able to retrieve store.foo. This only happens with @do, and not with @visible

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

No branches or pull requests

1 participant