Skip to content

Commit 7d9f8a5

Browse files
committed
chore: replace conditionals-utils with @bigmistqke/solid-whenever
1 parent 9322568 commit 7d9f8a5

6 files changed

Lines changed: 24 additions & 154 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
}
7373
},
7474
"dependencies": {
75+
"@bigmistqke/solid-whenever": "^0.1.0",
7576
"@solid-primitives/resize-observer": "^2.0.25",
7677
"debounce": "^2.1.0"
7778
},

playground/controls/OrbitControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { whenEffect } from "@bigmistqke/solid-whenever"
12
import { createEffect, createMemo, onCleanup, type Ref } from "solid-js"
23
import type { Event } from "three"
34
import { OrbitControls as ThreeOrbitControls } from "three-stdlib"
45
import { useFrame, useThree, type S3 } from "../../src/index.ts"
56
import { useProps } from "../../src/props.ts"
6-
import { whenEffect } from "../../src/utils/conditionals.ts"
77
import { processProps } from "./process-props.ts"
88

99
export interface OrbitControlsProps extends S3.Props<typeof ThreeOrbitControls> {

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { whenMemo } from "@bigmistqke/solid-whenever"
12
import {
23
type Accessor,
34
type JSX,
@@ -9,13 +10,12 @@ import {
910
mergeProps,
1011
splitProps,
1112
} from "solid-js"
12-
import { Object3D } from "three"
13+
import { Loader, Object3D } from "three"
1314
import { threeContext, useThree } from "./hooks.ts"
1415
import { useProps } from "./props.ts"
15-
import type { Constructor, Loader, Meta, Overwrite, Props } from "./types.ts"
16+
import type { Constructor, Meta, Overwrite, Props } from "./types.ts"
1617
import { type InstanceOf } from "./types.ts"
1718
import { autodispose, hasMeta, isConstructor, load, meta, withContext } from "./utils.ts"
18-
import { whenMemo } from "./utils/conditionals.ts"
1919

2020
/**********************************************************************************/
2121
/* */
@@ -118,15 +118,15 @@ export function Entity<T extends object | Constructor<object>>(props: EntityProp
118118
/* */
119119
/**********************************************************************************/
120120

121-
type ResourceProps<TSource, TResult extends object> = Omit<Props<TResult>, "children"> & {
122-
loader: new () => Loader<TSource, TResult>
123-
url: TSource
121+
type ResourceProps<TUrl, TResult extends object> = Omit<Props<TResult>, "children"> & {
122+
loader: new () => Loader<TResult, TUrl>
123+
url: TUrl
124124
path?: string
125125
children?: (result: Accessor<TResult>) => JSXElement
126126
}
127127

128-
export function Resource<TSource extends string | string[], TResult extends object>(
129-
props: ResourceProps<TSource, TResult>,
128+
export function Resource<TUrl extends string | string[], TResult extends object>(
129+
props: ResourceProps<TUrl, TResult>,
130130
) {
131131
const [config, rest] = splitProps(props, ["loader", "path", "url"])
132132
const loader = createMemo(() => new config.loader())

src/utils/conditionals.ts

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/utils/use-measure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { when, whenEffect } from "@bigmistqke/solid-whenever"
12
import { createEffect, createMemo, createSignal, mergeProps, onCleanup } from "solid-js"
2-
import { when, whenEffect } from "./conditionals.ts"
33
import { debounce as createDebounce } from "./debounce.ts"
44

55
declare type ResizeObserverCallback = (entries: any[], observer: ResizeObserver) => void

0 commit comments

Comments
 (0)