eisbuk / EisBuk

Manage bookings for ice skating lessons
GNU Affero General Public License v3.0
0 stars 1 forks source link

Enhancement/react redux firebase firestore updates #909

Closed ikusteu closed 8 months ago

ikusteu commented 8 months ago

Sets up react-redux-firebase-firestore to accommodate for some of the single auth / multiple athletes functionality.

Creates useUpdateSubscription - as react-redux-firebase-firestore is optimised for consumers being created and removed, some of the state (e.g. constraints with respect to metadata) is "cached" and doesn't update with updated meta. This hook extends this functionality to explicitly update the subscription when the dependencies change, in a useEffect-like manner.

I've tried to think of some tests for this, but it's a bit niche and hard to test. When the functionality is fully wired in, the behaviour is tested using e2e tests (which, in this case, I feel are most representative)