GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

make contract reading more async #72

Closed dcsan closed 2 years ago

dcsan commented 2 years ago

so that images (letters stream in as we're reading them...)

image

dcsan commented 2 years ago

51

dcsan commented 2 years ago

@keepRunning nice job on speed up! wondering what else we could do here...

            Promise.all([metadata, tokenURI, info]).then(values => {

i was thinking to try to update the store on EACH letter as it comes in... so the letters stream into the display. that would mean buffering each of the 3 calls per letter?

            var metadata = LetterUtils.getMetadata(tokenId, graphemeContract);
            var tokenURI = graphemeContract.tokenURI(tokenId)
            var info = LetterUtils.getInfo(tokenId, graphemeContract);

tokenURI could be added to getInfo ? so we can reduce one call?

I made it async but i think somehow the canvas drawing of ALL the letters is causing an image stutter. we need a way to allow a redraw after loading each one...

anyway it's only the first load.

dcsan commented 2 years ago

OK i added async but actually I think it is worse as it triggers rendering ALL the items again - I think. so i'm gonna revert to just once when done...