feat(): typed @ionic/docs (#19547)

This commit is contained in:
Manu MA
2019-10-08 20:35:45 +02:00
committed by GitHub
parent bb32cea5c9
commit 3c4e65ba97
6 changed files with 14 additions and 13 deletions

View File

@@ -2,7 +2,6 @@ import { Build, Component, ComponentInterface, Element, Host, h } from '@stencil
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
import { rIC } from '../../utils/helpers';
import { isPlatform } from '../../utils/platform';
@Component({
@@ -52,3 +51,11 @@ export class App implements ComponentInterface {
const needInputShims = () => {
return isPlatform(window, 'ios') && isPlatform(window, 'mobile');
};
const rIC = (callback: () => void) => {
if ('requestIdleCallback' in window) {
(window as any).requestIdleCallback(callback);
} else {
setTimeout(callback, 32);
}
};

View File

@@ -1,7 +1,6 @@
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
import { rIC } from '../../utils/helpers.js';
import { SwiperInterface, SwiperOptions } from './swiper/swiper-interface';
@@ -142,7 +141,7 @@ export class Slides implements ComponentInterface {
childList: true,
subtree: true
});
rIC(() => this.initSwiper());
this.el.componentOnReady().then(() => this.initSwiper());
}
async disconnectedCallback() {