({
mode,
store,
queries,
}: {
readonly mode: string;
readonly store?: Store;
readonly queries?: Queries;
})
| 732 | }; |
| 733 | |
| 734 | const State = ({ |
| 735 | mode, |
| 736 | store, |
| 737 | queries, |
| 738 | }: { |
| 739 | readonly mode: string; |
| 740 | readonly store?: Store; |
| 741 | readonly queries?: Queries; |
| 742 | }) => { |
| 743 | const [tables, setTables] = useTablesState(store); |
| 744 | const [table, setTable] = useTableState('t1', store); |
| 745 | const [row, setRow] = useRowState('t1', 'r1', store); |
| 746 | const [cell, setCell] = useCellState('t1', 'r1', 'c1', store); |
| 747 | const [values, setValues] = useValuesState(store); |
| 748 | const [value, setValue] = useValueState('v1', store); |
| 749 | const [paramValues, setParamValues] = useParamValuesState('q1', queries); |
| 750 | const [paramValue, setParamValue] = useParamValueState('q1', 'p1', queries); |
| 751 | const state = { |
| 752 | tablesState: [tables, () => setTables({t1: {r1: {c1: 2}}})], |
| 753 | tableState: [table, () => setTable({r1: {c1: 2}})], |
| 754 | rowState: [row, () => setRow({c1: 2})], |
| 755 | cellState: [cell, () => setCell(2)], |
| 756 | valuesState: [values, () => setValues({v1: 2})], |
| 757 | valueState: [value, () => setValue(2)], |
| 758 | paramValuesState: [paramValues, () => setParamValues({p1: 2})], |
| 759 | paramValueState: [paramValue, () => setParamValue(2)], |
| 760 | }[mode] as [unknown, () => void]; |
| 761 | const _handleClick = state[1]; |
| 762 | return ( |
| 763 | <> |
| 764 | {JSON.stringify(state[0])} |
| 765 | <button onClick={_handleClick}>Set</button> |
| 766 | </> |
| 767 | ); |
| 768 | }; |
| 769 | |
| 770 | const Writer = ({ |
| 771 | mode, |
nothing calls this directly
no test coverage detected
searching dependent graphs…