1 2 3 4 5 6 7 8 9 10 11 12 13
// state.js // App state definition and helpers export const initialState = { query: '', pokemon: null, loading: false, error: null }; export function cloneState(state) { return JSON.parse(JSON.stringify(state)); }