0.1.3 #4

Merged
Thilawyn merged 90 commits from next into master 2025-08-23 03:07:28 +02:00
3 changed files with 10 additions and 8 deletions
Showing only changes of commit c39f4c912f - Show all commits

View File

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

View File

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

View File

@@ -25,16 +25,12 @@ const RouteComponent = Component.makeUntraced(function* RouteComponent() {
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))
return <Text>{id}</Text>
})
}) {}
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")({
component: RouteComponent,