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