Skip to content

Instantly share code, notes, and snippets.

View StringKe's full-sized avatar

StringKe StringKe

View GitHub Profile
@StringKe
StringKe / focusPropAtom.ts
Created April 26, 2024 03:40
[Jotai Atom] Atomic implementations that allow parent objects to be potentially null
type PickProp<T, K> = K extends keyof NonNullable<T>
? T extends undefined
? NonNullable<T>[K] | undefined
: NonNullable<T>[K]
: undefined;
export function focusPropAtom<Store, Result, Key extends keyof NonNullable<Store>>(
baseAtom: WritableAtom<Store, [SetStateAction<Store>], Result>,
path: Key,
) {
@anchan828
anchan828 / README.md
Last active April 1, 2025 14:23
This is an improvement to allow @nestjs/typeorm@8.1.x to handle CustomRepository. I won't explain it specifically, but it will help in some way. https://github.com/nestjs/typeorm/pull/1233

You need to provide some classes and decorators yourself to maintain the same style as typeorm@2.x.

1. EntityRepository -> CustomRepository

@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}