@@ -10,6 +10,7 @@ export type TypeId = typeof TypeId
|
||||
export interface Component<E, R, P extends {}> extends Pipeable.Pipeable, Component.Options {
|
||||
new(_: never): {}
|
||||
readonly [TypeId]: TypeId
|
||||
/** @internal */
|
||||
makeFunctionComponent(runtimeRef: React.Ref<Runtime.Runtime<Exclude<R, Scope.Scope>>>, scope: Scope.Scope): React.FC<P>
|
||||
readonly body: (props: P) => Effect.Effect<React.ReactNode, E, R>
|
||||
}
|
||||
@@ -327,7 +328,7 @@ export const withOptions: {
|
||||
self: T,
|
||||
options: Partial<Component.Options>,
|
||||
): T => Object.setPrototypeOf(
|
||||
{ ...self, ...options },
|
||||
Object.assign(function() {}, self, options),
|
||||
Object.getPrototypeOf(self),
|
||||
))
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export const isMemoized = (u: unknown): u is Memoized<any> => Predicate.hasPrope
|
||||
export const memo = <T extends Component.Component<any, any, any>>(
|
||||
self: T
|
||||
): T & Memoized<Component.Component.Props<T>> => Object.setPrototypeOf(
|
||||
{ ...self, ...MemoizedProto },
|
||||
Object.assign(function() {}, self, MemoizedProto),
|
||||
Object.getPrototypeOf(self),
|
||||
)
|
||||
|
||||
@@ -42,6 +42,6 @@ export const withOptions: {
|
||||
self: T,
|
||||
options: Partial<Memoized.Options<Component.Component.Props<T>>>,
|
||||
): T => Object.setPrototypeOf(
|
||||
{ ...self, ...options },
|
||||
Object.assign(function() {}, self, options),
|
||||
Object.getPrototypeOf(self),
|
||||
))
|
||||
|
||||
@@ -53,7 +53,7 @@ export const suspense = <T extends Component.Component<any, any, P>, P extends {
|
||||
& Component.Component<Component.Component.Error<T>, Component.Component.Context<T>, P & Suspense.Props>
|
||||
& Suspense
|
||||
) => Object.setPrototypeOf(
|
||||
{ ...self, ...SuspenseProto },
|
||||
Object.assign(function() {}, self, SuspenseProto),
|
||||
Object.getPrototypeOf(self),
|
||||
)
|
||||
|
||||
@@ -69,6 +69,6 @@ export const withOptions: {
|
||||
self: T,
|
||||
options: Partial<Suspense.Options>,
|
||||
): T => Object.setPrototypeOf(
|
||||
{ ...self, ...options },
|
||||
Object.assign(function() {}, self, options),
|
||||
Object.getPrototypeOf(self),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user