本文整理匯總了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({});
}
示例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');
}