mobx-utils
mobx-utils copied to clipboard
Utility functions and common patterns for MobX
> Multiple clocks with the same interval will automatically be synchronized. The fact that timers are synchronized, will make multiple unit tests share state between them. **Here is unit test...
I found a race in code using `fromPromise`. When rapidly sending new requests in quick succession, created with `fromPromise`, the `case` method will temporarily return `undefined` until the latest response...
When `useProxies` is set to `"ifavailable"`, `createTransformer` may throw error in some use cases (see repro). This issue should be related to mobxjs/mobx#2876 Repro: https://codesandbox.io/s/mobx-defineproperty-forked-q4q6k?file=/src/index.ts
https://github.com/mobxjs/mobx-utils/blob/3a1ee03527950a44c5ce57007344a56a9b974c94/src/lazy-observable.ts#L45 Given that we're fine to omit the initial value fallback, `current()` can return `undefined` while the promise is unresolved. The code snippet example even compares `current() === undefined`.
I have a simple case that looks something like this: ```javascript const myArray = observable([]); deepObserve(myArray, () => { console.log("array update"); }); runInAction(() => { myArray.length = 1; myArray.length =...
Getting tons of the warning "`invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set`" due to calling methods that use computedFns inside tests. Ex:...
I noticed that the Symbol.observable, that should contain itself, is commented in the IObservableStream, which breaks compatibility with latest rxjs `from` function. https://github.com/mobxjs/mobx-utils/blob/master/src/observable-stream.ts#L22 Resulting in `Argument of type 'IObservableStream' is...
The `computedFn` function doesn't allow a varying number of arguments, between calls to the function it returns. This is apparently already known, since the function description says: > computedFn(fn) returns...
repro: * repro.mjs ```ts import {observable, runInAction} from 'mobx'; import {deepObserve} from 'mobx-utils'; const set = observable.set([1, 2, 3]); const obj = observable({bla: true}); deepObserve(set, (change, path, root) => console.log(change,...