Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 728 Bytes

lifecycle-hooks.md

File metadata and controls

38 lines (32 loc) · 728 Bytes

Lifecycle hooks

You can use any of the Luigi lifecycle hooks by adding additional setup to the root of the Luigi configuration object. Here is an example:

{
  ...
  lifecycleHooks: {
    luigiAfterInit: () => {
      // initializing with a different language
      myGeoLocationService.getLanguage().then(lang => {
        Luigi.i18n().setCurrentLocale(lang);
      })
    }
  }
  ...
}

luigiAfterInit()

This method will be called after Luigi.setConfig({}) is executed.