MCPcopy Create free account
hub / github.com/BetaSu/big-react / lazy

Function lazy

packages/react/src/lazy.ts:74–89  ·  view source on GitHub ↗
(
	ctor: () => Thenable<{ default: T }>
)

Source from the content-addressed store, hash-verified

72}
73
74export function lazy<T>(
75 ctor: () => Thenable<{ default: T }>
76): LazyComponent<T, Payload<T>> {
77 const payload: Payload<T> = {
78 _status: Uninitialized,
79 _result: ctor
80 };
81
82 const lazyType: LazyComponent<T, Payload<T>> = {
83 $$typeof: REACT_LAZY_TYPE,
84 _payload: payload,
85 _init: lazyInitializer
86 };
87
88 return lazyType;
89}

Callers 1

main.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected