MCPcopy Create free account
hub / github.com/Effect-TS/effect / Stack

Function Stack

packages/ui/native/src/kit/Stack.ts:78–103  ·  view source on GitHub ↗
(
  h: Native.H<Msg>,
  options: StackOptions<A, R, T>
)

Source from the content-addressed store, hash-verified

76 * @since 4.2.0
77 */
78export const Stack = <Msg, A, R = never, T = never>(
79 h: Native.H<Msg>,
80 options: StackOptions<A, R, T>
81): Native.ViewElement<Msg, R | T, Native.ViewEvents, "view"> => {
82 const { entries, transition } = options
83 const screen = options.screen as Draw
84 if (transition !== undefined) {
85 return transition.draw(h, entries, screen) as any
86 }
87 const top = entries.length - 1
88 return h.view.style({ flex: 1 }).children(
89 entries.map((entry, index) =>
90 Screen(h, {
91 key: String(entry.id),
92 props: {
93 entry,
94 index,
95 covered: index < top,
96 fade: true,
97 depth: 1,
98 draw: screen
99 }
100 })
101 )
102 ) as any
103}

Callers 4

makeAppFunction · 0.90
makeAppFunction · 0.90
App.tsFile · 0.90

Calls 5

ScreenInterface · 0.90
styleMethod · 0.65
StringFunction · 0.50
childrenMethod · 0.45
mapMethod · 0.45

Tested by 2

makeAppFunction · 0.72
makeAppFunction · 0.72