as Default
Sets this instance as defaultInstance and returns it.
Runs block with this instance as the default, restoring the previous default when the block exits.
stormify.asDefault { s -> s.read<User>(...) }Content copied to clipboard
Not safe under concurrent use. While the block runs, every thread that reads defaultInstance observes this instance — the override is process-wide, not thread-local. In a multi-threaded environment (e.g. a server handling parallel requests), pass the Stormify instance explicitly instead of relying on the default inside the block.