mobx-state-tree Questions

2

I want to import a node module with @import, but it seems visual studio code is not getting it. Or am I doing it wrong?

2

Solved

The recommended way to do asynchronous actions in MobX-state-tree (MST) is to use flow, which takes a generator function as first argument in which every promise should be yielded. yield expression...
Contraceptive asked 19/12, 2020 at 20:18

6

Why should I use MobX State Tree over vanilla MobX? It seems like any time I read about MobX, MST is mentioned in the same place. Is anyone actually using just MobX by itself? Probably too general...
Darksome asked 17/3, 2019 at 21:8

3

Solved

I'm trying to create a model with a optional, nullable string value. I've tried using both hint: types.optional(types.string, ""), and hint: types.maybe(types.string), Both results in erro...
Road asked 14/8, 2018 at 11:45

1

Solved

I'm using Axios to handle some API fetching, and I'm executing that call within a generator; async/await is not an option for this particular project. For some reason, even though axios is getting ...

4

Solved

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

2

Solved

I'm using mobx-state-tree with Typescript in a React application. And, I'm having an issue with Typescript where it complains about the type of the mobx type types.safeReference. It looks like the ...
Winograd asked 29/1, 2021 at 16:51

3

I am using react and mobx-state-tree and I use @inject to inject the stores into my component. So in the end I access the store via this.props.uiStore inside of my component. Unfortunately Visual ...
Churl asked 1/3, 2019 at 9:5

2

I am writing an electron app and I keep all my app data inside a single MST tree. Now I noticed that every now and then you run into a situation where data becomes inconsistent (missing reference o...
Fluorescent asked 3/9, 2019 at 8:5

2

Context I have a React application that is backed by mobx-state-tree (MST). One of the pages makes two parallel API calls to fetch a list of Projects and a list of system Users. The responses of ...
Defelice asked 25/11, 2018 at 3:36

1

Solved

I need to persist a MST Store in React Native. The data is changed seldomly. I'm confused between using AsyncStorage and AutoRun.
Luxe asked 16/6, 2018 at 12:21

3

I have this basic model. const stuff = types.model({ term: types.string, excludeTerm: types.string, stores: types.array(types.string) }).actions(self => ({ setTerm(term: string) { self.term...
Leighton asked 15/4, 2019 at 12:33

1

Solved

I have a bunch of stores each containing a list of one entity type like const userStore = EntityStore.create(....) const supplierStore = EntityStore.create(....) Some stores can offer additiona...
Fermin asked 7/2, 2019 at 5:0

1

I'm trying to clone a model that references another model, but I get: Error: [mobx-state-tree] Failed to resolve reference 'H1qH2j20z' to type 'AnonymousModel' (from node: /usualCustomer)... in the...
Hemline asked 18/5, 2018 at 20:28

2

Solved

I have a Mobx State Tree model that has grown too long and I would like to split it across multiple javascript files. Here is a demo of some of the code: ///file1.js import { types } from "mobx-...
Creel asked 7/1, 2019 at 19:7

1

Solved

I have some interfaces already, and I want to describe models with this interfaces, just like the code below. Otherwise I have to write again by using types of mobx-state-tree. But this is not the ...
Bashaw asked 16/10, 2018 at 5:30

1

Solved

I am trying to make a Nav in reactjs with Mobx State Tree. Right now I have skinny vertical Nav bar with a list of icons. Now what I want to do is add sub menu items to certain ones. When these o...
Litalitany asked 4/6, 2018 at 22:32
1

© 2022 - 2024 — McMap. All rights reserved.