Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/Fabulous.Tests/APISketchTests/TestUI.Widgets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,6 @@ module TestUI_Widgets =
: Content<'msg> =
CollectionBuilder.yieldImpl x

[<Extension>]
static member inline YieldFrom<'msg, 'marker, 'itemMarker when 'msg: equality and 'itemMarker :> IMarker>
(_: CollectionBuilder<'msg, 'marker, IMarker>, x: WidgetBuilder<'msg, 'itemMarker> seq)
: Content<'msg> =
// TODO optimize this one with addMut
{ Widgets = x |> Seq.map(fun wb -> wb.Compile()) |> Seq.toArray |> MutStackArray1.fromArray }




///------------------
type StatefulView<'arg, 'model, 'msg, 'marker when 'msg: equality> =
{ Init: 'arg -> 'model
Expand Down
8 changes: 8 additions & 0 deletions src/Fabulous/Builders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ type CollectionBuilder<'msg, 'marker, 'itemMarker when 'msg: equality> =

res

member inline _.YieldFrom(sequence: WidgetBuilder<'msg, 'itemMarker> seq) : Content<'msg> =
// TODO optimize this one with addMut
{ Widgets =
sequence
|> Seq.map(fun wb -> wb.Compile())
|> Seq.toArray
|> MutStackArray1.fromArray }

[<EditorBrowsable(EditorBrowsableState.Never)>]
member inline x.AddScalar(attr: ScalarAttribute) =
let struct (scalarAttributes, widgetAttributes, widgetCollectionAttributes, environmentAttributes) =
Expand Down
Loading