InvTrack / invtrack

GNU General Public License v3.0
1 stars 2 forks source link

Centralize query keys #112

Open michalstruck opened 8 months ago

michalstruck commented 8 months ago

Create a file in db/hooks where all the query keys will be stored as functions, where the dependencies are its arguments. As in

const keys = {
  listBarcodes: (inventoryId: number) => ["listBarcodes", inventoryId],
};

These will be imported to query functions as well as optimistic updates, preventing query key name mixups