idea-plugin / arrow.meta.ide.dsl.application / ApplicationSyntax / addAppLifecycleListener

addAppLifecycleListener

open fun MetaIde.addAppLifecycleListener(listener: AppLifecycleListener): ExtensionPhase

registers an activity, which is executed eagerly in the background on startup.

See Also

PreloadingActivity

open fun MetaIde.addAppLifecycleListener(appClosing: () -> Unit = Noop.effect0, projectOpenFailed: () -> Unit = Noop.effect0, appFrameCreated: (cliArgs: MutableList<String>) -> Unit = Noop.effect1, welcomeScreenDisplayed: () -> Unit = Noop.effect0, projectFrameClosed: () -> Unit = Noop.effect0, appStarting: (cliProject: Project?) -> Unit = Noop.effect1, appWillBeClosed: (restarted: Boolean) -> Unit = Noop.effect1): ExtensionPhase

registers an AppLifecycleListener.

import arrow.meta.ide.IdePlugin
import arrow.meta.ide.MetaIde
import arrow.meta.ide.invoke

val MetaIde.goodbye: IdePlugin
  get() = "Goodbye after Application is closed" {
    meta(
      addAppLifecycleListener(
        appClosing = {
          println("Ciao!, Au revoir!, Adeus!, Tot ziens!, Пока!, ¡Adiós!, Tschüss!, 再见")
        }
      )
    )
  }

Do you like Arrow?

Arrow Org
<