• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript timer.setTimeout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中timer.setTimeout函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setTimeout函数的具体用法?TypeScript setTimeout怎么用?TypeScript setTimeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setTimeout函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: constructor

    constructor() {
        disable();
        // >> setting-specific-tracing-categories
        setCategories(categories.concat(
            categories.Binding,
            categories.Layout,
            categories.Style,
            categories.ViewHierarchy,
            categories.VisualTreeEvents
        ));
        enable();
        // << setting-specific-tracing-categories

        // >> trace-add-categories
        addCategories(categories.Navigation);
        // << trace-add-categories

        setTimeout(function () {
            console.log("-----------------------------------------------------");
            console.log("New trace category has been added");
            console.log("Category: NativeLifecycle");
            console.log("-----------------------------------------------------");
            alert("NativeLifecycle trace category has been added.");
            addCategories(categories.NativeLifecycle);
        }, 2000);

        write("I (heart) NativeScript!", categories.Debug);
    }
开发者ID:aymenbraiek,项目名称:nativescript-sdk-examples-ng,代码行数:28,代码来源:trace-specific-categories-example.component.ts


示例2: onLoadMoreItemsRequested

 public onLoadMoreItemsRequested(args: ListViewEventData) {
   console.log(`Loading more data`);
   this.store.dispatch(this.pokemonActions.loadMore());
   // TODO
   timerModule.setTimeout(function () {
     const listView = args.object;
     listView.notifyLoadOnDemandFinished();
   }, 1000);
 }
开发者ID:xmlking,项目名称:WearableHub,代码行数:9,代码来源:pokemon-list-pro.component.ts


示例3: onPullToRefreshInitiated

 public onPullToRefreshInitiated(args: ListViewEventData) {
   console.log(`ItemComponent - pull to refresh`);
   this.store.dispatch(this.pokemonActions.load());
   const that = new WeakRef(this);
   // TODO
   timerModule.setTimeout(function () {
     const listView = args.object;
     listView.notifyPullToRefreshFinished();
   }, 1000);
 }
开发者ID:xmlking,项目名称:WearableHub,代码行数:10,代码来源:pokemon-list-pro.component.ts


示例4: function

 webViewDidFinishLoad: function(webView:UIWebView) {
     
     // The webview fires webViewDidFinishLoad multiple times - I suspect because it's also
     // counting iframe loads. So we need to make sure we only set this timer once - then we
     // set it to null once it actually fires.
     
     if (!this.changePageTimeout) {
         this.changePageTimeout = setTimeout(this.moveToRandomArticleLink.bind(this), 30000);
     }
 },
开发者ID:burkeholland,项目名称:nativescript-webview-experiment,代码行数:10,代码来源:detector-controller.ts


示例5: while

            (function(j){
                timer.setTimeout(() => {
                    let key = input.items[j].val;

                    let i = j - 1;
                    while(i >= 0 && input.items[i].val > key){
                        input.items[i + 1].val = input.items[i].val;
                        i = i - 1;
                    } 
                    input.items[i + 1].val = key;
                    input.setCurrent(input.items[i + 1]);
                },500 * j);
            })(j);
开发者ID:thelgevold,项目名称:native-script-poc,代码行数:13,代码来源:insertion-sort.service.ts


示例6: reject

    return new Promise<defModule.Location>((resolve, reject) => {
        if (!defModule.LocationManager.isEnabled()) {
            return reject(new Error("Location service is disabled"));
        }

        var timer: typeof timerModule = require("timer");

        locationManager.startLocationMonitoring(function (location: defModule.Location) {
            if (options && ("number" === typeof options.maximumAge)) {
                if (location.timestamp.valueOf() + options.maximumAge > new Date().valueOf()) {
                    locationManager.stopLocationMonitoring();
                    if ("undefined" !== typeof timerId) {
                        timer.clearTimeout(timerId);
                    }
                    resolve(location);
                }
            }
            else {
                locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                resolve(location);
            }
        }, function (error: Error) {
                console.error('Location error received: ' + error);
                locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                reject(error);
            },
            options
            );

        if (options && ("number" === typeof options.timeout)) {
            timerId = timer.setTimeout(function () {
                locationManager.stopLocationMonitoring();
                reject(new Error("timeout searching for location"));
            }, options.timeout || defaultGetLocationTimeout);
        }
    });
开发者ID:329379172,项目名称:NativeScript,代码行数:42,代码来源:location-common.ts



注:本文中的timer.setTimeout函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript timer.setInterval函数代码示例发布时间:2022-05-25
下一篇:
TypeScript timer.setInterval函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap