"Easy Peasy provides you with an intuitive API to quickly and easily manage the state for your React application. Batteries are included - no configuration is required to support derived state, API calls, performance optimisation, developer tools etc."
Questions tagged [easy-peasy]
50 questions
12
votes
4 answers
Does redux evaluate all listeners to the store on any update to the store?
From what I can tell, redux will notify all subscribers to the store when anything in the store changes no matter if it's a subscription to a deeply nested leaf or a subscription to the top level of the state.
In an application where you follow the…

david_adler
- 9,690
- 6
- 57
- 97
10
votes
1 answer
Easy Peasy VS React Redux
Recently I found this library: https://easy-peasy.vercel.app/
Implemented it, and must say it was quite nice. Why it is not so popular as redux? why people tend to use redux when they can use this? What are the advantages and disadvantages of…

MD10
- 1,313
- 3
- 12
- 35
6
votes
1 answer
Easy-peasy useStoreActions not updating state immediately?
lets say this is my code
const donation = useStoreState(
state => state.user.initialState.donationData,
)
const setDonation = useStoreActions(
actions => actions.donation.setDonation,
)
setDonation({
amount: 1000000,
…

Nathan Priyasadie
- 133
- 2
- 8
5
votes
2 answers
Can't persist state in React Native using easy-peasy
I'm getting the following error, when passing AsyncStorage as the storage engine:
WARN Possible Unhandled Promise Rejection (id: 0):
Error: [AsyncStorage] Passing null/undefined as value is not supported. If you want to remove value, Use…

Florian D
- 51
- 3
4
votes
1 answer
Accessing multiple easy-peasy stores from single component
I'm trying to access 2 different stores in a single component, but worry that perhaps the architecture of my app may need to change as easy-peasy may not have this functionality.
I have a GlobalStore
import { createStore } from 'easy-peasy';
const…

mcclosa
- 943
- 7
- 29
- 59
3
votes
1 answer
react easy-peasy component is not rerendered when the global state is modified
I'm new to react and this could be a fairly simple question to answer. I'm using easy-peasy for state management and I have an action that updates global state, but the component is not re-rendered even after global state is updated.
Here is the…

Pumpkin Pie
- 510
- 1
- 4
- 15
2
votes
1 answer
How to use reactotron-redux with easy-peasy?
/* eslint-disable import/no-cycle */
import {action, createStore} from 'easy-peasy';
import reactotron from 'reactotron-react-native';
import {applyMiddleware, compose} from 'redux';
import drawerModal from '../models/drawerModal';
let…

Rajesh N
- 6,198
- 2
- 47
- 58
2
votes
2 answers
Why when following the quick start for easy peasy is my state not changing in Nextjs?
I was trying to use easy peasy for global state management within a nextjs app and was running into problems where the state would only update when I changed pages. I thought maybe I didn't quite grasp what I was doing so I decided to try a quick…

Valstorm
- 31
- 3
2
votes
1 answer
TypeScript alias does not "remember" unused generic type params or aliased type
Please forgive my verbosity in asking this question:
A library I'm using (which is an abstraction of redux), called easy-peasy, exposes the following types to be used in conjunction with one another. The Thunk type has several unused generic params,…

no_stack_dub_sack
- 452
- 3
- 12
2
votes
0 answers
React Js apps / Microsoft Edge error:SCRIPT1028: Expected identifier, string or number
On my react app I'm receiving this error:
SCRIPT1028: Expected identifier, string or number
It seems to come from my Store.js with easy-peasy
const store = createStore({
answers: [],
totalPoints: 0,
otp: "",
loading: false,
addAnswer:…

Bradley Bousoula
- 75
- 1
- 6
2
votes
0 answers
React with Easy Peasy TypeError: enrolment[1] is undefined
I m wondering why my code is not working :
When I start the app it doesn't work
If i change anything on the fly, it's working !
It seems to be something like when I start the server all data is not yet loaded in easy peasy so the const is…

NatV
- 21
- 3
2
votes
2 answers
React listen to 1st state change only
I am using useEffect in react to listen to redux(easy-peasy) state change, but I want to listen to 1st value change only.
Because when my page loads the state has a default value and then API call is made and hence data changes but the API is a…

Varun Sukheja
- 6,170
- 5
- 51
- 93
2
votes
2 answers
useEffect() cause re-renders and multiple requests to api
Problem
Functional component causes multiple re-renders causing multiple ajax requests. What is the solution for this?
This is my code.
export default function MyMenu() {
let menu = useStoreState(state => state.menu.menu);
const getMenu =…

Farman Ali
- 97
- 10
2
votes
1 answer
Unhandled Rejection (TypeError): illegal operation attempted on a revoked proxy
I'm using easy-peasy (redux based state management) and I don't know why I'm getting this error when I'm calling action method in useEffect in the below code:
Unhandled Rejection (TypeError): illegal operation attempted on a revoked proxy
import…

Saifur Rehman
- 55
- 6
1
vote
1 answer
easy-peasy: useStoreState not working with ES6 class instances
In easy-peasy, the useStoreState() hook does not cause a re-render when we use the hook to access the store's field that stores an ES6 class instance. For example:
store.js
import { action, createStore } from "easy-peasy";
class Person {
…

AnsonH
- 2,460
- 2
- 15
- 29