Skip to content

Commit 95fde98

Browse files
Use the new IAsyncComputedValueBase from vue-async-computed as the options type
Thi uses the IAsyncComputedValueBase type added in foxbenjaminfox/vue-async-computed#91
1 parent 5df5566 commit 95fde98

File tree

3 files changed

+6
-37
lines changed

3 files changed

+6
-37
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"author": "Benjamin Fox <foxbenjaminfox@gmail.com>",
1515
"license": "MIT",
1616
"dependencies": {
17-
"vue-async-computed": "^3.8.2",
17+
"vue-async-computed": "^3.8.3",
1818
"vue-class-component": "^7.2.5"
1919
},
2020
"bugs": {

src/index.ts

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
1-
import { IAsyncComputedValue } from "vue-async-computed";
1+
import { IAsyncComputedValue, IAsyncComputedValueBase } from "vue-async-computed";
22
import { createDecorator, VueDecorator } from "vue-class-component";
33

4-
export interface IAsyncComputedOptions<TResult> {
5-
// NOTE: We cannot reuse the IAsyncComputedValue<T> interface from
6-
// 'vue-async-computed' because it requires the presence of a 'get'
7-
// property (which is obviously the decorated function in this case).
8-
9-
/**
10-
* The default value or a function which return the default value that will
11-
* be used until the data is loaded for the first time.
12-
*/
13-
default?: TResult | (() => TResult);
14-
15-
/**
16-
* An array of (nested) properties which are additional dependencies of
17-
* this computed value.
18-
*/
19-
watch?: string[] | (() => void);
20-
21-
/**
22-
* A function which determines whether the recalculation of the value is
23-
* required or not.
24-
*/
25-
shouldUpdate?: () => boolean;
26-
27-
/**
28-
* This flag indicates whether the value will be computed on first access
29-
* or immediately when initializing the corresponding Vue component.
30-
*
31-
* By default, or if this flag is `false`, the former behavior will take
32-
* place, otherwise (if the flag is `true`) the latter one will happen.
33-
*/
34-
lazy?: boolean;
35-
}
4+
export type IAsyncComputedOptions<T> = IAsyncComputedValueBase<T>;
365

376
export default function AsyncComputed<TResult>(
387
computedOptions?: IAsyncComputedOptions<TResult>): VueDecorator {

0 commit comments

Comments
 (0)