Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Observable, Subject } from '@reactivex/rxjs';
// set up the server
// register an Object
var mySubject = new Subject();
var subscription = mySubject.subscribe(
(x:any) => {
console.log('Next: ' + x);
},
(err:any) => {
console.log('Error: ' + err);
},
() => {
console.log('Completed');
});
// push info into the Object
mySubject.next('foo');
import { Subject } from '@reactivex/rxjs'
import { Actions } from 'shared/actions'
const _dispatcher = new Subject()
// Hide the subject, so the outer world doesn't abuse it
const dispatcher =
_dispatcher
.asObservable()
.publishReplay(1)
.refCount()
export const DONT_USE_UNLESS_YOUR_NAME_IS_ACTION_CREATOR = _dispatcher
function buildFilterFunction (args) {
// Check if has actions
const hasActions =
Object.keys(args)
.some(key => Object.keys(Actions).indexOf(args[key]) !== -1)
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require('react');
var ConsoleProvider_1 = require('./ConsoleProvider');
var rxjs_1 = require('@reactivex/rxjs');
var Store_1 = require('./Store');
var console$ = new rxjs_1.Subject();
var ConsoleProvider = (function () {
function ConsoleProvider() {
var _this = this;
this.add = function (severity, message) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var entry = { severity: severity, message: message, args: args };
console$.next(entry);
console.log.apply(console, [message].concat(args));
};
this.log = function (message) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
import * as React from 'react';
import { Reducer } from 'redux';
import { Severity, IConsoleEntry, IConsoleProvider } from './ConsoleProvider';
import { Subscription, Observable, Subject } from '@reactivex/rxjs';
import { getStore, getState, ConsoleAction } from './Store';
var console$ = new Subject();
export class ConsoleProvider implements IConsoleProvider {
add = (severity: Severity, message: any, ...args: any[]) => {
let entry: IConsoleEntry = { severity, message, args };
console$.next(entry);
console.log(message, ...args);
}
log = (message: any, ...args: any[]) => {
this.add(Severity.info, message, ...args);
}
info = (message: any, ...args: any[]) => {
this.add(Severity.info, message, ...args);
}
trace = (message: any, ...args: any[]) => {
this.add(Severity.trace, message, ...args);
}
function Weather() {
var _this = this;
this.weatherDataSubject = new Rx.Subject();
this.weatherDetailSubject = new Rx.Subject();
this.weatherForcastSubject = new Rx.Subject();
this.getWeatherDetails = function (city) {
_this.firebase.child('/' + city + '/currently').on("value", function (result) {
_this.weatherDetailSubject.next(result.val());
});
_this.firebase.child('/' + city + '/daily/data').on("value", function (result) {
_this.weatherForcastSubject.next(result.val());
});
};
this.firebase = new Firebase('https://publicdata-weather.firebaseio.com');
this.firebase.on("value", function (result) {
_this.weatherDataSubject.next(result.val());
});
}
return Weather;
constructor() {
this.inStream$ = new Rx.Subject();
this.action$ = this.inStream$.flatMap(v => {
if (v instanceof Rx.Observable) {
return v;
} else {
return Rx.Observable.from([v]);
}
}).share();
this.dispatch = this.dispatch.bind(this);
}
constructor(props) {
super(props);
this.state = {};
this.urls = new Subject();
this.photoUrlChange = this.photoUrlChange.bind(this);
this.nameChange = this.nameChange.bind(this);
this.formSubmit = this.formSubmit.bind(this);
}
function Weather() {
var _this = this;
this.weatherDataSubject = new Rx.Subject();
this.weatherDetailSubject = new Rx.Subject();
this.weatherForcastSubject = new Rx.Subject();
this.getWeatherDetails = function (city) {
_this.firebase.child('/' + city + '/currently').on("value", function (result) {
_this.weatherDetailSubject.next(result.val());
});
_this.firebase.child('/' + city + '/daily/data').on("value", function (result) {
_this.weatherForcastSubject.next(result.val());
});
};
this.firebase = new Firebase('https://publicdata-weather.firebaseio.com');
this.firebase.on("value", function (result) {
_this.weatherDataSubject.next(result.val());
});
}
return Weather;
function Chat(props) {
var _this = _super.call(this, props) || this;
_this.store = Store_1.createStore();
_this.typingActivity$ = new rxjs_1.Subject();
exports.konsole.log("BotChat.Chat props", props);
if (props.formatOptions)
_this.store.dispatch({ type: 'Set_Format_Options', options: props.formatOptions });
_this.store.dispatch({ type: 'Set_Localized_Strings', strings: Strings_1.strings(props.locale || window.navigator.language) });
return _this;
}
Chat.prototype.handleIncomingActivity = function (activity) {
function Weather() {
var _this = this;
this.weatherDataSubject = new Rx.Subject();
this.weatherDetailSubject = new Rx.Subject();
this.weatherForcastSubject = new Rx.Subject();
this.getWeatherDetails = function (city) {
_this.firebase.child('/' + city + '/currently').on("value", function (result) {
_this.weatherDetailSubject.next(result.val());
});
_this.firebase.child('/' + city + '/daily/data').on("value", function (result) {
_this.weatherForcastSubject.next(result.val());
});
};
this.firebase = new Firebase('https://publicdata-weather.firebaseio.com');
this.firebase.on("value", function (result) {
_this.weatherDataSubject.next(result.val());
});
}
return Weather;