Skip to content

Commit d7cdf83

Browse files
committed
Shortened component interface name
1 parent 62a9123 commit d7cdf83

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/shared/src/element.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { getAttributeProps } from './parse';
2-
import { IComponentFunction, CustomElement } from './model';
2+
import { IComponent, CustomElement } from './model';
33

44
/* -----------------------------------
55
*
66
* Async
77
*
88
* -------------------------------- */
99

10-
function getAsyncComponent(
11-
component: Promise<IComponentFunction>,
12-
tagName: string
13-
): Promise<any> {
10+
function getAsyncComponent(component: Promise<IComponent>, tagName: string): Promise<any> {
1411
return component.then((response) => getComponentResult(response, tagName));
1512
}
1613

@@ -20,7 +17,7 @@ function getAsyncComponent(
2017
*
2118
* -------------------------------- */
2219

23-
function getComponentResult(response: IComponentFunction, tagName: string) {
20+
function getComponentResult(response: IComponent, tagName: string) {
2421
if (typeof response === 'function') {
2522
return response;
2623
}

packages/shared/src/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* -------------------------------- */
66

7-
type IComponentFunction = () => Function | object;
7+
type IComponent = () => Function | object;
88

99
/* -----------------------------------
1010
*
@@ -72,4 +72,4 @@ const isPromise = (input: any): input is Promise<any> => {
7272
*
7373
* -------------------------------- */
7474

75-
export { IComponentFunction, IOptions, IProps, ErrorTypes, CustomElement, isPromise };
75+
export { IComponent, IOptions, IProps, ErrorTypes, CustomElement, isPromise };

0 commit comments

Comments
 (0)