DynamicInserter

com.raquo.laminar.inserters.DynamicInserter
class DynamicInserter(initialContext: Option[InsertContext], preferStrictMode: Boolean, insertFn: (InsertContext, Owner, UndefOr[InserterHooks]) => Subscription, hooks: UndefOr[InserterHooks]) extends Inserter, Hookable[DynamicInserter]

Inserter is a modifier that lets you insert child node(s) on mount. When used with onMountInsert, it "immediately" reserves an insertion spot and then on every mount it inserts the node(s) into the same spot.

Note: As a Modifier this is not idempotent, but overall it behaves as you would expect. See docs for more details.

Note: If you DO provide initialContext, its parentNode MUST always be the same element that you apply this Modifier to.

Attributes

Graph
Supertypes
trait Inserter
trait Modifier[Base]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def apply(element: Base): Unit

You can count on this method being a no-op in your libraries and end user code.

You can count on this method being a no-op in your libraries and end user code.

The reason this method is not abstract is to avoid broken SAM sugar in case of meta modifiers. See https://github.com/raquo/scala-dom-types/issues/27

Attributes

Definition Classes
def bind(element: Base): DynamicSubscription

Call this to get a copy of Inserter with a context locked to a certain element. We use this to "reserve a spot" for future nodes when a bind(c => inserter) modifier is initialized, as opposed to waiting until subscription is activated.

Call this to get a copy of Inserter with a context locked to a certain element. We use this to "reserve a spot" for future nodes when a bind(c => inserter) modifier is initialized, as opposed to waiting until subscription is activated.

The arrangement is admittedly a bit weird, but is required to build a smooth end user API.

Attributes

override def withHooks(addHooks: InserterHooks): DynamicInserter

Create a copy of the inserter that will apply these additional hooks after the original inserter's hooks.

Create a copy of the inserter that will apply these additional hooks after the original inserter's hooks.

Attributes

Definition Classes