Skip to content

User input is blocked  #4

@Sundin

Description

@Sundin

Hi! Thanks for this library and the wonderful blog post.

I have wrapped my data loading using next-frame, something like this:

async loadData() { 
    ...get contentArray from database...

    await Promise.all(contentArray.map(async (item) => { 
            await nextFrame(); 
            ...do some stuff with item...
    }));

    ...do some more stuff...
}

It sure prevented the GUI rendering from being blocked while the data loads, but for some reason the GUI doesn't respond to any input (pressing buttons etc) until the loadData method has finished. Do I do something wrong or is this just the way it is?

Update:
Just out of curiosity, I put like ten await nextFrame(); in there, and then the GUI got more responsive, even if the data loading obviously took a lot longer to finish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions