Questions tagged [easy-peasy]

"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."

50 questions
0
votes
1 answer

React Material-UI Snackbar component - storing multiple snackbars in state

I am using the React MUI library with NextJS I am trying to create a function where snackbars generated are stored in an array within the store (using a redux like library called Easy-Peasy) and then shown one by one as they timeout. E.g. if there…
aabdulahad
  • 483
  • 2
  • 11
0
votes
1 answer

Can we use store from different libraries together in react project?

Right now we are using easy peasy in our project, now we want to remove easy peasy store gradually and replace it with reduxtoolkit. Can we use stores with different libraries in react? Or is any alternative way to deal with this situation. Tried…
0
votes
1 answer

Easy-Peasy StoreProvider returns the error "Property 'children' does not exist on type..."

I got this error on Why? What can be wrong with the children? :( TS2769: No overload matches this call. Overload 1 of 2, '(props: { store: Store>; } | Readonly<{ store:…
podeig
  • 2,597
  • 8
  • 36
  • 60
0
votes
0 answers

How useStoreState is referring values in react?

I am pretty new to react and easy-peasy, I am stuck with one implementation with useStoreState. I just want to understand how the useStoreState and useStoreAction work in the below code and how state.AdminCompanyInfo and action.AdminCompanyInfo are…
Mayank
  • 1,351
  • 5
  • 23
  • 42
0
votes
1 answer

React with easy-peasy

My route: const id = req.params.id const event = await events.findByPk(id, { include: [clubs] }) return res.json(event) }) Result in Postman: { "id": 12, "title": "Title", "description": "Short description", "clubId":…
0
votes
1 answer

easy-peasy computed does not take inputs

The Redux library easy-peasy has a function called computed which is an alternative to standard Redux selectors: import { computed } from 'easy-peasy' const model = { session: { totalPrice: computed(state => state.price + state.tax) …
Mohammed Ibrahim
  • 418
  • 4
  • 11
0
votes
2 answers

How do I persist to local storage with easy-peasy redux

I'm building a react ecommerce website and I am using easy-peasy redux. I want to persist to localStorage when I add to cart. I can't find anything on their documentation about how to persist to localStorage. easy-peasy is configured to persist to…
mide358
  • 1
  • 2
0
votes
2 answers

React and easy-peasy - How to reset full state?

I can't find a way to reset full state to a new one. As soon as I try one or the other approach, sometimes it seems to work (with smaller new state), but most of the time my components re-render (because of state change and I assume not yet…
Karmalakas
  • 1,143
  • 2
  • 19
  • 39
0
votes
1 answer

Error: Error in useStoreState: Cannot read properties of undefined (reading 'getState') - easy-peasy

Using easy-peasy on my next js code, i am trying to store some values. But when i try tu use some stored values, i get the title error. What should I do? My estructure is: My code is: _app.js import { StoreProvider } from 'easy-peasy'; import…
Germano
  • 358
  • 1
  • 2
  • 13
0
votes
1 answer

EasyPeasy store hook causes rerender upon any state change

We currently have a redux state with nested models with the following structure. { groups: { ids: [], status: {}, error: {} }, members: { ids: [], status: {}, error: {} } For convenience, each model has an exported…
KwehDev
  • 261
  • 1
  • 3
  • 14
0
votes
0 answers

Can't update state

I have an array that I get from a hook - the playlists and a trying to put it in the state, in the playlistsLocal, but it seems that my state variable is still empty when I view it in the console. I know that setting the state is asynchronous and…
Cristian Sfetcu
  • 153
  • 1
  • 8
0
votes
1 answer

react cannot update state with easy peasy

model.js import axios from "axios" import { action } from "easy-peasy" export default { video: [], // Actions getVideo: action((state, id) => { axios.get(`http://localhost:8000/videos/${id}`) .then(res => { …
Lun
  • 861
  • 1
  • 10
  • 18
0
votes
1 answer

how to display my list from store at initialization with easy-peasy?

I want to get a list of churches from the store at initialization but i can't. The log get my initial array and the new one but doesn't display. Log below: log here is my model: const churchModel = { items: [], // ACTIONS setAllChurches:…
0
votes
2 answers

Can't access state using 'useStoreState in react easy-peasy

I recently decided to learn about state management with easy-peasy, and followed along the basic tutorials, but i can't seem to access the state. Here is the App component :- import model from './model'; import Todo from './components/Todo.tsx'; …
Ashim Khan
  • 11
  • 1
0
votes
1 answer

Easy-Peasy access other models

I am using easy-peasy as the state manager of react application In the actionOn I need to access state of another model, How can I access todos.items in the notes.onAddNote ? import { createStore, StoreProvider, action, actionOn } from…
WebMaster
  • 3,050
  • 4
  • 25
  • 77