Questions tagged [mobx]

Functional reactive programming library in JavaScript.

About

MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming. The philosophy behind MobX is very simple:

Anything that can be derived from the application state, should be derived. Automatically.

which includes the UI, data serialization, server communication, etc.

Links

1876 questions
0
votes
1 answer

Reload react component after updating state inside useEffect

I have a react component, I am updating a state in Mobx, and would like when this state is updated to reload the same component. I have a list of agencies, and I get the agency by type using query parameters within one component and based on the…
Sean
  • 33
  • 4
0
votes
2 answers

How to correctly save the value in sharedPreferences? - Flutter

Where am I going wrong? I have login with google to get the token and send it to graphgl, this token is saved (it was meant to be) in sharedpreferences, but it is not saving, I have the following action (mobx). @action Future loginWithGoogle() async…
João Mello
  • 304
  • 3
  • 12
0
votes
2 answers

Mobx React with Material Grid

I think this is a simple enough question. I am trying to create a material ui grid in react and be able to add rows to it. I've tried several variations of patterns and nothing is working for me. I'm pasting the sample below, and you can find the…
Scott
  • 458
  • 4
  • 10
0
votes
1 answer

How to use static property using typescript mobx

I need to create a card payment page which need to show saved cards. Also it has the capability to save new cards. I am using a static string array to store saved cards. But in html rendering it gives an error that "Property 'cards' is a static…
Ruchira Nawarathna
  • 1,137
  • 17
  • 30
0
votes
1 answer

Mobx - change observable array inside reaction

I started using MobX recently, and I came across the reaction concept. I understand reactions as functions, that runs side-effects. It is up to me, what side-effects are. I use reaction to update my MobX state. If you check my code below, I have a…
exoslav
  • 2,094
  • 3
  • 21
  • 26
0
votes
1 answer

Mobx is not observing object properties which were not defined on initialization

Example Code interface Car { id: string, wheels: string, engine: string } class ExampleStore { @Observable car:Car public set car(value: Car){ this.car = value } } //Setting value of the car for the first time const carExample = { …
Harsh Nagalla
  • 1,198
  • 5
  • 14
  • 26
0
votes
1 answer

Updating mobx store after database insertion

Is there a way to send an event with js to trigger a ui update (refresh?) off database insertion? I'm building a web app to handle a queuing system for my school. I've gotten the major systems in place and working. Tutors are reading off a active q…
NLand
  • 19
  • 3
0
votes
1 answer

Can't get react-tracking to work with Typescript, Function components and React-hooks

i am using react.js with typescript, react-hooks and function components. working on prem, I can't use cloud tracking solutions like google analytics, or new relic. also - due to licensing issues, i can't buy an on-prem tracking server solution - so…
0
votes
1 answer

Convert Data object from apollo hook call to Javascript Array

I am trying to convert the 'Data' structure element from apollo hook call to an array I can pass to render in React. Here is my hook call using the '@apollo/react-hooks' library. const { data, loading, error } = useQuery(findTokenQuery) How can I…
John Worthley
  • 93
  • 1
  • 1
  • 7
0
votes
2 answers

Mobx How to get better performance profile information?

I am trying to profile and optimize a mobx app using the Chrome inspector performance tab. There is a screen shot below. Lots of information in this stack trace is misleading and unhelpful as it points to internal mobx functions like…
kevzettler
  • 4,783
  • 15
  • 58
  • 103
0
votes
0 answers

Are these two the same?

I am learning Mobx. when(predicate: () => boolean, effect?: () => void, options?) As written on mobx: class MyResource { constructor() { when( () => !this.isVisible, () => this.dispose() ); } …
0
votes
1 answer

MobX stated that there is a provided value cannot be converted to observable in the StoreProvider component

I am using MobX in a Next.js app. The problem is in the StoreProvider component. I follow the instruction on this website. The problem is [mobx] The provided value could not be converted into an observable. If you want just create an observable…
0
votes
2 answers

State changes in a react application with mobX

My task is to show the download component when data from the server has not yet arrived. export const LoaderComponent = () => ( ); const styles =…
MegaRoks
  • 898
  • 2
  • 13
  • 30
0
votes
1 answer

Handle relational data in Flutter with MobX

I'm new to Flutter and I'm trying to create an app for a personal project. The project is a content sharing platform where you can upload sound files or image files inside Albums that you created. The backend is written in Django / Django Rest…
a-coruble
  • 411
  • 4
  • 15
0
votes
1 answer

Cant get the value of an ajax call in an action in mobx, instead I get Proxy

I just learned Mobx, I have this simple setup where I have my store with some things like: selectedFood: "pizza" and some functions that do something like changing that selected value: selectFood: (food) => store.selectedFood = food, This is my…
user2643810
1 2 3
99
100