refactor: types refactor

This commit is contained in:
Evan You
2018-10-08 18:09:13 -04:00
parent ba918b5afe
commit d22b71b27e
11 changed files with 74 additions and 64 deletions

View File

@@ -40,7 +40,7 @@ export function createAsyncComponent(
error: errorComp
} = options
return class AsyncContainer extends Component<AsyncContainerData> {
return class AsyncContainer extends Component<{}, AsyncContainerData> {
data() {
return {
comp: null,

View File

@@ -8,7 +8,7 @@ interface ProviderProps {
value: any
}
export class Provide extends Component<{}, ProviderProps> {
export class Provide extends Component<ProviderProps> {
updateValue() {
// TS doesn't allow symbol as index :/
// https://github.com/Microsoft/TypeScript/issues/24587

View File

@@ -15,7 +15,7 @@ type Cache = Map<CacheKey, VNode>
export const KeepAliveSymbol = Symbol()
export class KeepAlive extends Component<{}, KeepAliveProps> {
export class KeepAlive extends Component<KeepAliveProps> {
cache: Cache = new Map()
keys: Set<CacheKey> = new Set()