The following guide will walk you through some of our recommended best practises for making the most out of RTK Query Loader.
📄️ 1. Create a base loader
A Loader can control the loading, fetch and error state views for consumer components.
📄️ 2. Extend the base loader
Extend from the base loader so that you inherit the sensible defaults. You can overwrite these at any point.
📄️ 3. Add queries
You can now start to add queries to your extended loaders.
📄️ 4. Arguments for your loader
If you want the loader to take an argument, all you have to do is to add a queriesArg:
📄️ 5. Consume the loader
Picking the right method