( uniqueId: Id, s: Store, )
| 6 | import {useCell} from '../ui-react/index.ts'; |
| 7 | |
| 8 | export const useEditable = ( |
| 9 | uniqueId: Id, |
| 10 | s: Store, |
| 11 | ): [boolean, (event: SyntheticEvent<HTMLImageElement>) => void] => [ |
| 12 | !!useCell(STATE_TABLE, uniqueId, EDITABLE_CELL, s), |
| 13 | useCallback( |
| 14 | (event: SyntheticEvent<HTMLImageElement>) => { |
| 15 | s.setCell(STATE_TABLE, uniqueId, EDITABLE_CELL, (editable) => !editable); |
| 16 | event.preventDefault(); |
| 17 | }, |
| 18 | [s, uniqueId], |
| 19 | ), |
| 20 | ]; |
no test coverage detected
searching dependent graphs…