Have any best practices or conventions or suggestions for naming custom hooks? #5198
-
Have any best practices or conventions or suggestions for naming custom hooks? For example, if I have 5 apis:
How should I name my custom hooks?
or
or
or
or others? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi 👋 I prefer the following:
So, for example:
Having said that, there's no right or wrong. Use whatever you and your team prefer 🙂 |
Beta Was this translation helpful? Give feedback.
-
anyone else ? |
Beta Was this translation helpful? Give feedback.
Hi 👋
I prefer the following:
use(obviously)Operation(if applicable/necessary)Entity(Device, for example)Type(Query/Mutation)
So, for example:
useDeviceQuery
useDeleteDeviceMutation
Having said that, there's no right or wrong. Use whatever you and your team prefer 🙂