Skip to content

Commit d0eb267

Browse files
committed
Add demo to README; fixes
1 parent ae7be4e commit d0eb267

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
Spreadsheet-like table UI for SolidJS.
1414

15+
__Demo:__ https://alexanderrafferty.com/projects/solid-tabular/
16+
1517
⚠️ This library is currently in early development, and breaking changes will definitely occur.
1618

1719
## Features

TODO

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
- Extract out context menu
22
- Extract out cell content
33
- Lift cell component to top level?
4-
- Column auto-sizing
5-
- Fix reactivity in Basic Usage story
4+
- Column auto-sizing

src/stories/Table.stories.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createSignal, onMount } from 'solid-js'
1+
import { createMemo, createSignal, onMount } from 'solid-js'
22
import type { Meta, StoryObj } from 'storybook-solidjs-vite'
33
import { fn } from 'storybook/test'
44
import { ActiveRange, Table } from 'src'
@@ -13,7 +13,7 @@ const meta = {
1313
const [activeRange, setActiveRange] = createSignal<ActiveRange>()
1414
const [widths, setWidths] = createSignal(new Map<string, number>())
1515

16-
const [data, setData] = createSignal<Record<string, unknown>[]>(props.data ?? [])
16+
const [fetchedData, setFetchedData] = createSignal<Record<string, unknown>[]>()
1717

1818
onMount(() => {
1919
if (!props.url) return
@@ -24,10 +24,12 @@ const meta = {
2424
header: true,
2525
skipEmptyLines: true,
2626
})
27-
setData(parsed.data)
27+
setFetchedData(parsed.data)
2828
})
2929
})
3030

31+
const data = createMemo(() => fetchedData() ?? props.data ?? [])
32+
3133
return (
3234
<div
3335
style={{

0 commit comments

Comments
 (0)