Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/solid/src/reactive/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function dispose(d: (() => void)[]) {

// Modified version of mapSample from S-array[https://github.com/adamhaile/S-array] by Adam Haile
export function mapArray<T, U>(
list: Accessor<readonly T[]>,
list: Accessor<readonly T[] | undefined | null | false>,
mapFn: (v: T, i: Accessor<number>) => U,
options: { fallback?: Accessor<any> } = {}
): () => U[] {
Expand Down Expand Up @@ -136,7 +136,7 @@ export function mapArray<T, U>(
}

export function indexArray<T, U>(
list: Accessor<readonly T[]>,
list: Accessor<readonly T[] | undefined | null | false>,
mapFn: (v: Accessor<T>, i: number) => U,
options: { fallback?: Accessor<any> } = {}
): () => U[] {
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export function createMemo<T>(
return readSignal.bind(c as Memo<T>);
}

export interface Resource<T> extends Accessor<T | undefined> {
export interface Resource<T> extends Accessor<T> {
loading: boolean;
error: any;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/solid/src/render/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mapArray, indexArray } from "../reactive/array";
import type { JSX } from "../jsx";

export function For<T, U extends JSX.Element>(props: {
each: readonly T[];
each: readonly T[] | undefined | null | false;
fallback?: JSX.Element;
children: (item: T, index: Accessor<number>) => U;
}) {
Expand All @@ -15,7 +15,7 @@ export function For<T, U extends JSX.Element>(props: {

// non-keyed
export function Index<T, U extends JSX.Element>(props: {
each: readonly T[];
each: readonly T[] | undefined | null | false;
fallback?: JSX.Element;
children: (item: Accessor<T>, index: number) => U;
}) {
Expand Down