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.
12 lines
265 B
JavaScript
12 lines
265 B
JavaScript
// 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;
|
|
},
|
|
});
|