View Source Lightning.BuildMacros (Lightning v2.10.4)

Macros for building Lightning.

Summary

Functions

Conditionally evaluates the block if the current environment is in the given list of environments.

Functions

Link to this macro

do_in(envs, list)

View Source (macro)
@spec do_in([atom()] | atom(), [{:do, Macro.t()}]) :: Macro.t()

Conditionally evaluates the block if the current environment is in the given list of environments.

Examples

do_in(:dev) do
  IO.puts("This will only be printed in the dev environment")
end

do_in([:dev, :test]) do
  IO.puts("This will only be printed in the dev and test environments")
end