()
| 8 | import { AuthWrapper } from './Auth'; |
| 9 | |
| 10 | const Counter = () => { |
| 11 | const database = useDatabase(); |
| 12 | const counterRef = ref(database, 'counter'); |
| 13 | const increment = (amountToIncrement) => { |
| 14 | return set(counterRef, rtdbIncrement(amountToIncrement)); |
| 15 | }; |
| 16 | |
| 17 | const response = useDatabaseObjectData(counterRef); |
| 18 | |
| 19 | const { data: count } = response; |
| 20 | |
| 21 | return ( |
| 22 | <> |
| 23 | <button onClick={() => increment(-1)}>-</button> |
| 24 | <span> {count as any} </span> |
| 25 | <button onClick={() => increment(1)}>+</button> |
| 26 | </> |
| 27 | ); |
| 28 | }; |
| 29 | |
| 30 | const AnimalsList = () => { |
| 31 | const database = useDatabase(); |
nothing calls this directly
no test coverage detected