Questions tagged [state-management]

1074 questions
5
votes
0 answers

Consumer widget is not rebuilding the UI when state updates

I am using flutter riverpod(State Notifier Provider) for state management. When I am updating the state the consumer widget is not rebuilding itself because of which the UI is not getting updated even though my state is getting updated. I am unable…
shekhar s
  • 51
  • 1
  • 3
5
votes
2 answers

Testing with bUnit and Moq a razor component that uses Fluxor

I used Fluxor for state management in in one of the razor components in my Blazor app and I'm not really sure how to set it up for testing with Moq. I can't just assing a value to students because it's an init only property. Is there a specific way…
5
votes
2 answers

How can I pass data in multi-step forms in NextJS?

I have started using NextJS and React recently. I am trying to implement the multi page forms in my app, but I don't know how can I persist and pass the form data from one page to another page. There are many guidelines about using state management…
Rehan
  • 454
  • 7
  • 19
5
votes
4 answers

Confusion between mobx-state-tree and mobx-keystone. When to use which?

Both recommended in the official Mobx page if one wants an opinionated way to using mobx for state management. Based on these(1,2), keystone seems like an improvement of state-tree. Having everything that state-tree has + more. Nowhere I could find…
5
votes
3 answers

How can I update the list after changing an Item status? (Flutter and Provider)

I have this problem: I have a list of Items, each with a favorite status, and I have a page that shows the favorite items. I want the page to update and remove the non-favorite items when I toggle the favorite status. Tried with…
Andrei
  • 53
  • 1
  • 1
  • 4
5
votes
2 answers

Maintaining same state on different pages in flutter for a particular use case

I know there have been certain questions on state management in flutter, but none of them seemed to solve my use case. Recently I was building an app based on E-commerce and encountered this real need for state management. I had 2 pages, One is the…
5
votes
0 answers

Flutter: Read the Stream data of a BloC state and re-render the UI if it changes

I have a problem with using the BloC pattern in combination with showing a download process using Dio. Can anybody tell me, how to get the onUploadProgress from dio into a bloc state and display it when the progress inside the state updates? At the…
SiLenT_Tz
  • 71
  • 5
5
votes
2 answers

Flutter provider state management, logout concept

I am trying to implement custom logout solution for my application, where no matter where user currently is, once the Logout button is clicked, app will navigate back to Login page. My idea was, that instead of listening on every component for state…
Robert J.
  • 2,631
  • 8
  • 32
  • 59
5
votes
1 answer

Could not find the correct Provider<>

I have a class that makes an HTTP get request and two screens the first one is displayed titles that fetched from API the second screen displays the posts that also fetched from the API and all using provider What I did is that in the main class…
Tabarek Ghassan
  • 716
  • 15
  • 28
5
votes
3 answers

Why do we need mutations, setters and getter for state management?

I am just now learning about state management in Vue.js and I can't quite understand why does it need to be so complicated and confusing with all these different methods (mutations, getters, setters). Isn't it more simple to change data directly?…
Liga
  • 3,291
  • 5
  • 34
  • 59
5
votes
2 answers

Best Practices for Storing JSON in URL Hash / Fragment

I'm building a single-page AJAX application, and would like to under certain circumstances store state in JSON after the URL hash (#). I've seen a couple other sites do this, but I'm hoping to get some best practices, tips, or gotchas as I work to…
DuckMaestro
  • 15,232
  • 11
  • 67
  • 85
5
votes
3 answers

How can I specify the shape of the state in a React/Redux application?

The thing that has puzzled me the most ever since I started reading about SPAs is how to handle the application state. Although I have found in Redux most of the answers I was looking for there's still a couple of things that I'm not sure how to…
eddy
  • 4,373
  • 16
  • 60
  • 94
5
votes
1 answer

Vuex - what data should be flowing through the store?

I understand what the store is and the purpose of Vuex, but now I'm thinking: "What do I actually put in the store?" The SPA I'm building handles a lot of data. Initially I was only putting in the "main" stuff. However, is that wrong? Should the…
Garfonzo
  • 3,876
  • 6
  • 43
  • 78
5
votes
2 answers

Any math approaches to state management of complex objects?

I usually use ASP.net web forms for GUI, maybe one of most "stateful" technologies. But it applies to any technology which has states. Sometimes forms are tricky and complex, with >30 elements and > 3 states of each element. Intuitive way of…
rudnev
  • 2,281
  • 3
  • 22
  • 31
5
votes
5 answers

Assigning DataTable to ViewState is a good way?

I'm getting a DataTable from a DataBase and assigning to ViewState like below: Because I don't want to hit the database for every time. DataTable dt = GetDataTable(); ViewState["dtTable"] = dt; GetDataTable() is a method, which retrieves 1000…
thevan
  • 10,052
  • 53
  • 137
  • 202