a
Size: a a a
a
a
I
function atomFactory<T>(initialValue: T) {
const atom: Atom<[T, number]> = declareAtom([initialValue, 0], on => [])
map(atom, value => value[0])
}
a
function atomFactory<T>(initialValue: T) {
const atom: Atom<[T, number]> = declareAtom([initialValue, 0], on => [])
map(atom, value => value[0])
}
function atomFactory<T>(initialValue: Exclude<T, undefined>) {
const atom: Atom<[Exclude<T, undefined>, number]> = declareAtom([initialValue, 0], on => [])
map(atom, value => value[0])
}
I
I
a
NS
function atomFactory<T>(initialValue: NonNullable<T>) {
// ..
}
I
I
I
NS
type NonUndefined<T> = T extends undefined ? never : T
function atomFactory<T>(initialValue: NonUndefined<T>) {
const atom: Atom<[NonUndefined<T>, number]> = declareAtom(
[initialValue, 0],
on => [],
)
map(atom, value => value[0])
}
I
I
a
a
a
Л