Giter Club home page Giter Club logo

Comments (5)

smalluban avatar smalluban commented on May 26, 2024 1

Thanks for creating an issue. It might be related to a bug (or the browser's change behavior of the Set iterators) in the internal cache mechanism.

I'll try to check it out ASAP.

from hybrids.

smalluban avatar smalluban commented on May 26, 2024

EDIT: https://codesandbox.io/s/hybrids-web-components-playground-forked-d2pcgl?file=/src/index.js

One tip about your example - if you use store factory and get posts in render, the store will try to fetch the list without id too. It must do this, as for listings it cannot assume that without id you don't want to fetch anything (like for a model instance, which requires id).

In the above codesandbox I made a slight change to your list method, so if id is falsy, it just returns an empty array. It then protects the case store.get([Post]) - you can alternatively throw an error if id does not fit your needs. Then, you can use store.error() in the render method to show that case.

from hybrids.

smalluban avatar smalluban commented on May 26, 2024

@Qsppl Please try v8.2.5. If the problem still occurs please re-open the issue.

from hybrids.

Qsppl avatar Qsppl commented on May 26, 2024

EDIT: https://codesandbox.io/s/hybrids-web-components-playground-forked-d2pcgl?file=/src/index.js

One tip about your example - if you use store factory and get posts in render, the store will try to fetch the list without id too. It must do this, as for listings it cannot assume that without id you don't want to fetch anything (like for a model instance, which requires id).

In the above codesandbox I made a slight change to your list method, so if id is falsy, it just returns an empty array. It then protects the case store.get([Post]) - you can alternatively throw an error if id does not fit your needs. Then, you can use store.error() in the render method to show that case.

In this case, it is impossible to distinguish between cases when we have not yet downloaded the data and when we have already downloaded the data and an empty array was actually returned from the server.

Also, the store.ready defender no longer means that the data download is complete.

I opened a issue on this topic before I saw your message:
#216

from hybrids.

Qsppl avatar Qsppl commented on May 26, 2024

EDIT: https://codesandbox.io/s/hybrids-web-components-playground-forked-d2pcgl?file=/src/index.js
One tip about your example - if you use store factory and get posts in render, the store will try to fetch the list without id too. It must do this, as for listings it cannot assume that without id you don't want to fetch anything (like for a model instance, which requires id).
In the above codesandbox I made a slight change to your list method, so if id is falsy, it just returns an empty array. It then protects the case store.get([Post]) - you can alternatively throw an error if id does not fit your needs. Then, you can use store.error() in the render method to show that case.

In this case, it is impossible to distinguish between cases when we have not yet downloaded the data and when we have already downloaded the data and an empty array was actually returned from the server.

Also, the store.ready defender no longer means that the data download is complete.

I opened a issue on this topic before I saw your message: #216

I'll try to load not the component model when clicked, but the entire component, like in Vue. This solution should create fewer problems.

from hybrids.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.