Skip to content

Page's handler called many time after render #22

@0xAaCE

Description

@0xAaCE

I am using a Page component to show a table, into the handler of the Page I am calling a function to query a DB and this function is called many times ramdomly which could be a bit problematic

Example:

export default new Page({
  name: 'Users',
  handler: async () => {
    const data = await getAllUsers()

    return new Layout({
    .
    .
    .

getAllUsers() is being called many times

Solution

Handler should be executed only once at the moment of render the page, or even better it would be nice have a way to control it. At least it would be necessary have a some explanation on the documentation when and why the handler function is executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions