Skip to main content

fetchDataOnInit

Description

Determines whether to fetch panel data on load or on panel focus. Default is true.

Type

boolean

Usage

m.lib.fetchDataOnInit = true  ' Fetch data on initialization (default)
m.lib.fetchDataOnInit = false ' Do not fetch data on initialization

Example

' Disable auto-fetch if you want to control when data is loaded
m.lib.fetchDataOnInit = false

m.lib.config = {
siteID: "your-site-id",
eventID: "your-event-id",
useProdEnv: true
}

' Manually trigger data fetch later when needed
' (Implementation depends on your use case)

When to Use

Set this to false when:

  • You want to defer data loading until panel focus
  • You are trying to increase performance for low end devices
  • You want more control over the initialization sequence

Best Practices

  • Default behavior (true) is suitable for most use cases
  • Only disable if you have a specific reason to control data loading timing