Fix
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2025-08-11 07:26:19 +02:00
parent fe68445fa9
commit c39f4c912f
3 changed files with 10 additions and 8 deletions

View File

@@ -27,7 +27,10 @@ export const memo = <T extends Component.Component<any, any, any, any>>(
self: T self: T
): T & Memo<Component.Component.Props<T>> => Object.setPrototypeOf( ): T & Memo<Component.Component.Props<T>> => Object.setPrototypeOf(
Object.assign(function() {}, self), Object.assign(function() {}, self),
Object.freeze({ ...Object.getPrototypeOf(self), ...MemoProto }), Object.freeze(Object.setPrototypeOf(
Object.assign({}, MemoProto),
Object.getPrototypeOf(self),
)),
) )
export const withOptions: { export const withOptions: {

View File

@@ -59,7 +59,10 @@ export const suspense = <T extends Component.Component<any, any, any, any>>(
& Suspense & Suspense
) => Object.setPrototypeOf( ) => Object.setPrototypeOf(
Object.assign(function() {}, self), Object.assign(function() {}, self),
Object.freeze({ ...Object.getPrototypeOf(self), ...SuspenseProto }), Object.freeze(Object.setPrototypeOf(
Object.assign({}, SuspenseProto),
Object.getPrototypeOf(self),
)),
) )
export const withOptions: { export const withOptions: {

View File

@@ -25,16 +25,12 @@ const RouteComponent = Component.makeUntraced(function* RouteComponent() {
Component.withRuntime(runtime.context) Component.withRuntime(runtime.context)
) )
const SubComponent = Component.makeUntraced(function* SubComponent() { class SubComponent extends Component.makeUntraced(function* SubComponent() {
const id = yield* makeUuid4.pipe(Effect.provide(GetRandomValues.CryptoRandom)) const id = yield* makeUuid4.pipe(Effect.provide(GetRandomValues.CryptoRandom))
return <Text>{id}</Text> return <Text>{id}</Text>
}) }) {}
class MemoizedSubComponent extends Memo.memo(SubComponent) {} class MemoizedSubComponent extends Memo.memo(SubComponent) {}
console.log(MemoizedSubComponent.prototype)
// console.log(Object.getPrototypeOf(SubComponent))
// console.log(Object.getPrototypeOf(MemoizedSubComponent))
export const Route = createFileRoute("/dev/memo")({ export const Route = createFileRoute("/dev/memo")({
component: RouteComponent, component: RouteComponent,