當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript BehaviorSubject.default方法代碼示例

本文整理匯總了TypeScript中rxjs.BehaviorSubject.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BehaviorSubject.default方法的具體用法?TypeScript BehaviorSubject.default怎麽用?TypeScript BehaviorSubject.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rxjs.BehaviorSubject的用法示例。


在下文中一共展示了BehaviorSubject.default方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

export const deselectActivity = () => {
    selectedActivity$().next({});
}
開發者ID:kpreeti096,項目名稱:BotFramework-Emulator,代碼行數:3,代碼來源:settings.ts

示例2: getStore

export const startup = () => {
    // When changes to settings are made, save to disk.
    let saveTimer;
    getStore().subscribe(() => {
        if (!acting) {
            acting = true;
            actors.forEach(actor => actor(getSettings()));
            acting = false;
        }
        clearTimeout(saveTimer);
        saveTimer = setTimeout(() => {
            saveSettings('client.json', new PersistentSettings(getStore().getState()));
        }, 1000);
    });

    selectedActivity$().subscribe((value) => {
        InspectorActions.setSelectedObject(value);
    });

    // Listen for new settings from the server.
    Electron.ipcRenderer.on('serverSettings', (event, ...args) => {
        const serverSettings = new ServerSettings(args[0]);
        ServerSettingsActions.set(serverSettings);
    });
    // Listen for log messages from the server.
    Electron.ipcRenderer.on('log-log', (event, ...args) => {
        log.log(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('log-info', (event, ...args) => {
        log.info(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('log-trace', (event, ...args) => {
        log.trace(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('log-debug', (event, ...args) => {
        log.debug(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('log-warn', (event, ...args) => {
        log.warn(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('log-error', (event, ...args) => {
        log.error(args[0], ...args.slice(1));
    });
    Electron.ipcRenderer.on('show-about', () => {
        AddressBarActions.showAbout()
    });
    Electron.ipcRenderer.on('open-menu', () => {
        HotkeyActions.openMenu()
    });
    Electron.ipcRenderer.on('toggle-address-bar-focus', () => {
        HotkeyActions.toggleAddressBarFocus()
    });
    Electron.ipcRenderer.on('new-conversation', (event, ...args) => {
        ConversationActions.newConversation(args[0]);
    });
    Electron.ipcRenderer.on('listening', (event, ...args) => {
        Emulator.serviceUrl = args[0].serviceUrl;
    });

    // Let the server know we're done starting up. In response, it will send us it's current settings (bot list and such).
    Electron.ipcRenderer.send('clientStarted');
}
開發者ID:kpreeti096,項目名稱:BotFramework-Emulator,代碼行數:62,代碼來源:settings.ts


注:本文中的rxjs.BehaviorSubject.default方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。