← Back to Stormify Documentation

asDefault

Sets this instance as defaultInstance and returns it.


fun <R> asDefault(block: (Stormify) -> R): R

Runs block with this instance as the default, restoring the previous default when the block exits. Use for scoped overrides such as per-request tenants.

stormify.asDefault { s -> s.read<User>(...) }