Mobx-utils/fromPromise.state is not Observable?
See original GitHub issueI try to react when state
change… but looks like state
is not a observable…
const result = fromPromise(promise);
console.assert(isObservable(result.state), 'state is NOT an isObservable'); // AssertionError: state is NOT an isObservable
Full code… https://runkit.com/ridermansb/mobx-react-is-observable/0.0.5
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
mobxjs/mobx-utils: Utility functions and common ... - GitHub
fromPromise takes a Promise, extends it with 2 observable properties that track the status of the promise and returns it. The returned object...
Read more >fromPromise · MobX Guide - mamaya-spark
FULFILLED . Observable promises can be created immediately in a certain state using fromPromise.reject(reason) or fromPromise.resolve(value?)
Read more >MobX - Observable value promised in a store constructor ...
FromPromise creates a new object wrapping the original promise. ... a normal promise in your example, not having a state property at all....
Read more >mobx-utils - npm
fromPromise takes a Promise, extends it with 2 observable properties that track the status of the promise and returns it. The returned object ......
Read more >mobx-utils: community driven utility belt for MobX - Medium
“fromPromise” takes a thennable and returns an object with the properties 'value', 'state' and 'reason'. These properties are all observable and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good point, could be marked as
@computed
to fix that. On the other hand, it doesn’t change the semantics, as there is an observable backing behind it. So the computed wouldn’t do really anything. Do you need it to be explicitly observable @Ridermansb ?