Giter Club home page Giter Club logo

use-asset's People

Contributors

amilajack avatar axelboc avatar drcmda avatar giulioz avatar gsimone avatar rijk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

use-asset's Issues

Allow asset hydration

Some frameworks like Next performs data prefetching in the server-side, providing the initial data for the whole app. Libraries like swr and react-query takes advantage of this by using the prefetched data as the initial cache data and performs the fetch process/cache invalidation only on client-side.

Asset hydration helps because React SSR cannot handle nor does not support Suspense (CM, however, supports this) and since the asset is guaranteed to have an initial data, the component does not have to suspend during SSR and the potentially suspending component can safely present its success UI.

I think something like asset.hydrate(args, data) or useAsset(asset, args, initialData) is a good API. Thoughts?

Relax peer dependencies

image

Does it need to have react-three-fiber and three as peer dependencies at all? It seems pretty generic, but perhaps I'm missing something.

Increase fetching threshold for infinite load on scroll example

I'm looking into using react-three-fiber and use-asset for one of my projects, and I've noticed that the infinite load example doesn't work on my display. Looking into the code, this condition for triggering fetching may never be true for larger screens:

e.target.scrollTop > content.current.scrollHeight - 1000

It's a very minor thing, but I was wondering if it makes sense to increase this threshold and make it independent of the screen size, e.g. something like:

e.target.scrollTop > content.current.scrollHeight / 2

And thanks very much for all the awesome work on the poimandres familiy of libraries! I really appreciate how you use the most interesting features of React to make sure that all the different use cases stay performant and simple to use. ๐Ÿ‘

Add support for asset typings

So that Typescript knows what type of variable is returned from e.g. asset.read() and you don't have to do something like this when consuming the asset:

const stuff = asset.read( name, ...args ) as StuffType // `as StuffType` should ideally not be necessary

reload api?

Is there reload api for refresh the asset?

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.