Refactor: Reorganize state management into atoms and selectors directories
Moved all Recoil atoms to a new 'atoms' directory and selectors to a 'selectors' directory to clarify the project structure and improve maintainability. This change separates concerns by clearly distinguishing between simple state (atoms) and derived state (selectors), facilitating better understanding and scalability of the application's state management.
This commit is contained in:
11
store/selectors/loadDataStore.js
Normal file
11
store/selectors/loadDataStore.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// store/loadDataStore.js
|
||||
import { atom } from "recoil";
|
||||
|
||||
export const loadDataStore = atom({
|
||||
key: "loadDataStore",
|
||||
default: async () => {
|
||||
const response = await fetch("/api/readLocations");
|
||||
const data = await response.json();
|
||||
return data;
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user