toothpick-runtime / toothpick / Toothpick / openScope

openScope

open static fun openScope(name: Any): Scope

Opens a scope without any parent. If a scope by this name already exists, it is returned. Otherwise a new scope is created.

Parameters

name - the name of the scope.

See Also
#openScopes(Object...)#openScope(Object, ScopeConfig)#closeScope(Object)

open static fun openScope(name: Any, scopeConfig: ScopeConfig): Scope

Opens a scope without any parent. If a scope by this name already exists, it is returned. Otherwise a new scope is created. If a new scope is created, then scopeConfig is applied to the new scope.

Parameters

name - the name of the scope.

scopeConfig - a lambda to configure the scope if it is created. The lambda is not applied if the scope existed already.

See Also
#openScopes(Object...)#openScope(Object)#closeScope(Object)