MCPcopy Create free account
hub / github.com/NV404/gova / wrapViewable

Function wrapViewable

component.go:53–58  ·  view source on GitHub ↗

wrapViewable turns a Viewable into a View by creating a componentNode whose renderFn invokes Body with the current scope.

(v Viewable)

Source from the content-addressed store, hash-verified

51
52// wrapViewable turns a Viewable into a View by creating a componentNode whose renderFn invokes Body with the current scope.
53func wrapViewable(v Viewable) View {
54 return &componentNode{
55 node: viewNode{kind: viewKindComponent},
56 renderFn: func(s *Scope) View { return v.Body(s) },
57 }
58}
59
60// asView converts an argument passed to a layout constructor into a View.
61// Accepts View (returned as-is), Viewable (wrapped), and nil (returned

Callers 2

ComponentFunction · 0.85
asViewFunction · 0.85

Calls 1

BodyMethod · 0.65

Tested by

no test coverage detected