Skip to content

Commit

Permalink
New plan: abandon autorunThrottled
Browse files Browse the repository at this point in the history
This changes the behaviour/signature of `throttledComputed`.
  • Loading branch information
danielearwicker committed Dec 24, 2020
1 parent ed21788 commit 48fb11a
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 9,293 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/built/test/asyncComputedTests.js",
"program": "${workspaceRoot}/built/test/asyncComputedRenderTests.js",
"cwd": "${workspaceRoot}",
"outFiles": [],
"sourceMaps": true
Expand Down
8 changes: 4 additions & 4 deletions docs/typedoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h3>Returns</h3>
<p>There is also a method <code>getNonReactive()</code> which can be used outside reactive contexts. It is
a convenience for writing unit tests. Note that it will return the most recent value that was
computed while the <code>asyncComputed</code> was being observed.</p>
<p><a href="docs/typedoc/modules/_asynccomputed_.html">Generated references docs</a></p>
<p><a href="http://earwicker.com/computed-async-mobx/typedoc/modules/_asynccomputed_.html">Generated references docs</a></p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h3>Example</h3>
</a>
Expand Down Expand Up @@ -149,7 +149,7 @@ <h3>Parameters</h3>
<h3>Returns</h3>
</a>
<p>Exactly as <code>asyncComputed</code>.</p>
<p><a href="docs/typedoc/modules/_promisedcomputed_.html">Generated references docs</a></p>
<p><a href="http://earwicker.com/computed-async-mobx/typedoc/modules/_promisedcomputed_.html">Generated references docs</a></p>
<a href="#example-1" id="example-1" style="color: inherit; text-decoration: none;">
<h3>Example</h3>
</a>
Expand Down Expand Up @@ -186,7 +186,7 @@ <h3>Returns</h3>
<p>It also has a <code>refresh</code> method that <em>immediately</em> (synchronously) re-evaluates the function.</p>
<p>The value returned from <code>get</code> is always a value obtained from the provided <code>compute</code> function,
never silently substituted.</p>
<p><a href="docs/typedoc/modules/_throttledcomputed_.html">Generated references docs</a></p>
<p><a href="http://earwicker.com/computed-async-mobx/typedoc/modules/_throttledcomputed_.html">Generated references docs</a></p>
<a href="#example-2" id="example-2" style="color: inherit; text-decoration: none;">
<h3>Example</h3>
</a>
Expand Down Expand Up @@ -223,7 +223,7 @@ <h3>Returns</h3>
is an observable, so it can be used from other MobX contexts. It can also be used outside
MobX reactive contexts but (like standard <code>computed</code>) it reverts to simply re-evaluating
every time you request the value.</p>
<p><a href="docs/typedoc/modules/_autorunthrottled_.html">Generated references docs</a></p>
<p><a href="http://earwicker.com/computed-async-mobx/typedoc/modules/_autorunthrottled_.html">Generated references docs</a></p>
<hr>
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
<h1>Installation</h1>
Expand Down
3 changes: 2 additions & 1 deletion interactive-tests/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { asyncComputed } from '../src/index';
import { delay } from '../test/delay';
import { makeObservable, observable } from 'mobx';
import { observable } from 'mobx';
import { observer } from 'mobx-react';
import { makeObservable } from '../src/mobxShim';

class SlowCalculatorModel {
x = "0";
Expand Down
Loading

0 comments on commit 48fb11a

Please sign in to comment.