-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hard to find a good name for this. It is an internal Laminar type, so I hope that it is not a big deal that it uses the same name as a Scala collection type. Internally, I always refer to it as `laminar.Seq` instead of just `Seq` to disambiguate it from the Scala collection type.
- Loading branch information
Showing
12 changed files
with
78 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletions
36
src/main/scala/com/raquo/laminar/modifiers/RenderableSeq.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
src/main/scala/com/raquo/laminar/receivers/LockedChildrenReceiver.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
package com.raquo.laminar.receivers | ||
|
||
import com.raquo.airstream.core.Source | ||
import com.raquo.laminar | ||
import com.raquo.laminar.api.L.children | ||
import com.raquo.laminar.inserters.{ChildrenSeq, DynamicInserter} | ||
import com.raquo.laminar.inserters.DynamicInserter | ||
import com.raquo.laminar.nodes.ChildNode | ||
|
||
class LockedChildrenReceiver( | ||
val nodes: ChildrenSeq[ChildNode.Base] | ||
val nodes: laminar.Seq[ChildNode.Base] | ||
) { | ||
|
||
/** If `include` is true, the nodes will be added. */ | ||
@inline def apply(include: Boolean): ChildrenSeq[ChildNode.Base] = { | ||
@inline def apply(include: Boolean): laminar.Seq[ChildNode.Base] = { | ||
this := include | ||
} | ||
|
||
/** If `include` is true, the nodes will be added. */ | ||
def :=(include: Boolean): ChildrenSeq[ChildNode.Base] = { | ||
if (include) nodes else ChildrenSeq.empty | ||
def :=(include: Boolean): laminar.Seq[ChildNode.Base] = { | ||
if (include) nodes else laminar.Seq.empty | ||
} | ||
|
||
/** If `includeSource` emits true, node will be added. Otherwise, it will be removed. */ | ||
def <--(includeSource: Source[Boolean]): DynamicInserter = { | ||
children <-- includeSource.toObservable.map(if (_) nodes else ChildrenSeq.empty) | ||
children <-- includeSource.toObservable.map(if (_) nodes else laminar.Seq.empty) | ||
} | ||
|
||
} |
Oops, something went wrong.