Host Data

Read the data your host app (the native iOS or Android app that runs your code, see Glossary) passes in, as signals. The example prints both kinds as JSON.

What it shows

  • LynxInitData — initData() holds the InitData (Glossary): what the host app passes when it opens your bundle, such as a user ID or a page parameter.
  • LynxGlobalData — globalData() holds the GlobalData (Glossary): what the host app shares with every bundle, such as the theme. The host app can change it while the app runs.
  • Services injected into private fields — inject() stores both services in #initData and #globalData.
  • Signals read from the template — initDataJson() and globalDataJson() read the signals, so the view updates when the data changes.