MountHooks
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait Laminar
Members list
Value members
Concrete methods
Bind a subscription on mount
Bind a subscription on mount
Example usage: onMountBind(ctx => someAttr <-- someObservable(ctx))
. See docs for details.
Attributes
Execute a callback on mount. Good for integrating third party libraries.
Execute a callback on mount. Good for integrating third party libraries.
The callback runs on every mount, not just the first one.
- Therefore, don't bind any subscriptions inside that you won't manually unbind on unmount.
- If you fail to unbind manually, you will have N copies of them after mounting this element N times.
- Use onMountBind or onMountInsert for that.
When the callback is called, the element is already mounted.
If you apply this modifier to an element that is already mounted, the callback will not fire until and unless it is unmounted and mounted again.
Attributes
Insert child node(s) on mount.
Insert child node(s) on mount.
Note: insert position is reserved as soon as this modifier is applied to the element. Basically it will insert elements in the same position, where you'd expect, on every mount.
Example usage: onMountInsert(ctx => child <-- someObservable)
. See docs for details.
Attributes
Set a property / attribute / style on mount. Similarly to other onMount methods, you only need this when: a) you need to access MountContext b) you truly need this to only happen on mount
Set a property / attribute / style on mount. Similarly to other onMount methods, you only need this when: a) you need to access MountContext b) you truly need this to only happen on mount
Example usage: onMountSet(ctx => someAttr := someValue(ctx))
. See docs for details.
Attributes
Combines onMountCallback and onUnmountCallback for easier integration.
Combines onMountCallback and onUnmountCallback for easier integration.
- Note that the same caveats apply as for those individual methods.
- See also: onMountUnmountCallbackWithState
Attributes
Combines onMountCallback and onUnmountCallback for easier integration.
Combines onMountCallback and onUnmountCallback for easier integration.
- Note that the same caveats apply as for those individual methods.
- The mount callback returns state which will be provided to the unmount callback.
- The unmount callback receives an Option of the state because it's possible that onMountUnmountCallbackWithState was called after the element was already mounted, in which case the mount callback defined here wouldn't have run.
Attributes
Execute a callback on unmount. Good for integrating third party libraries.
Execute a callback on unmount. Good for integrating third party libraries.
When the callback is called, the element is still mounted.
If you apply this modifier to an element that is already unmounted, the callback will not fire until and unless it is mounted and then unmounted again.
Attributes
Concrete fields
Focus this element on mount
Focus this element on mount