nativescript-observable-subscribe NativeScript 插件

程序名称:nativescript-observable-subscribe

授权协议: MIT

操作系统: Android

开发语言: JavaScript

nativescript-observable-subscribe 介绍

nativescript-observable-subscribe 是一个能添加订阅功能到 observables 的
NativeScript 模块。

使用:

// viewmodel.js
    ...
    var mainViewModel = new HelloWorldModel();
    var counterPropName = 'counter';
    mainViewModel.subscribe(counterPropName, function(args){
        if (this.get(counterPropName) <= 0) {
            this.set(messagePropName, "Hoorraaay! You unlocked the NativeScript clicker achievement!");
        }
        else {
            this.set(messagePropName, this.get(counterPropName) + " taps left");
        } 
    }, mainViewModel);
    exports.mainViewModel = mainViewModel;

nativescript-observable-subscribe 官网

https://github.com/alexziskind1/nativescript-observable-subscribe

相关编程语言

BBGestureBack Full screen return gesture(全屏手...
Framework7 或者叫 F7 是全功能的绑定 iOS 7 应用的...
iOS 调试库,支持 iOS8+,无需添加任何代码,方便 i...
DarkModeKit是在Apple官方的深色模式发布之前设计和...
SimpleNote iOS 版客户端。SimpleNote 是一款在多平...
Kivy iOS,此工具旨在为 iOS 编译必要的库以运行应用...