0.1.2 #3

Merged
Thilawyn merged 28 commits from next into master 2025-07-23 21:28:25 +02:00
3 changed files with 6 additions and 5 deletions
Showing only changes of commit 76b5ccd0e1 - Show all commits

View File

@@ -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),
))

View File

@@ -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),
))

View File

@@ -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),
))