import { Repeat, Range, IndexRange } from "../src/index.js";
import { type Component, createSignal, onCleanup } from "solid-js";
import { TransitionGroup } from "solid-transition-group";
import { createStore } from "solid-js/store";
const Ball = (props: { n: number }) => (
{props.n}
);
const Fallback = () => fallback
;
const App: Component = () => {
const [state, setState] = createStore({
start: 5,
to: -5,
step: 2,
});
const shuffle = () => {
// const start = 1;
// const to = 2;
// const step = 1.5;
const start = Math.round(Math.random() * 10 - 6);
const to = Math.round(Math.random() * 10 - 2);
const step = Math.round(Math.random() * 4);
setState({ start, to, step });
};
// const [state, setState] = createStore({
// start: 0,
// to: -5,
// step: -0.5
// });
const i = setInterval(shuffle, 6000);
onCleanup(() => clearInterval(i));
return (
Start: {state.start}, To: {state.to}, Step: {state.step}
Repeat component
}>
{n => }
Range component
}>
{n => }
IndexRange component
}>
{n => }
);
};
export default App;