Skip to content

lazy Option Overview

In makeModule, the lazy option determines when modules (and their dependencies) are initialized.

lazy = true (default)

• Initialization on Demand

A module is only initialized at the moment you access the relevant value. If a module’s internal function never tries to retrieve a dependency, that dependency is not initialized.

lazy = false

• Eager Initialization

When you call the top-level module, all dependencies are initialized up front, regardless of whether their values are explicitly referenced in the module’s body.