constructor( private afterStarterService: AfterStarterService, private daemonService: DaemonService ) { this.afterStarterService.appStarted.subscribe(() => this.daemonService.notifyDaemon() ); }
async register() { await Container.set(OrbitDb, new orbitDb(this.ipfs)); const odbContainer: OrbitDb = Container.get(OrbitDb); this.exitHandlerService.errorHandler.subscribe(() => { odbContainer.stop(); odbContainer.disconnect(); }); }
// Subscribe subject.subscribe( data => console.log('Next', data), error => console.error('Error', error), () => console.log('Complete') );
//Sends the challenge code to Instagram async function solveChallenge() { return new Promise(async function(resolve, reject) { //Asks the user for the code let question = "What is the code Instagram sent you? (It can be found in your Email/SMS)\n"; let code = await askQuestion(question); //Sends the code to Instagram await Bluebird.try(async() => { console.log(await ig.challenge.sendSecurityCode(code)); if (ig.account) { //Serialize session cookie (This gets invoked after every call to Instagram) ig.request.end$.subscribe(async () => { const serialized = await ig.state.serialize(); delete serialized.constants; //This deletes the version info, so you'll always use the version provided by the library saveSession(serialized); }); console.log("Successfully logged in to Instagram!"); resolve(); } }).catch(IgChallengeWrongCodeError, async() => { //The code entered was wrong, so we call this function again console.log("The code given was incorrect! Please type it in again."); solveChallenge(); }); }); }
const sub = this.open.subscribe(v => { if (v !== this.state.getValue().display) { this.state.next({
wsMessage.subscribe(function (message) { let payload = {message}; clients.forEach(client => { sendObjectToWs(client, { action: 'message', payload: payload }); }); });
this.currentTrack.onEnded.subscribe( (index) => onTrackEnd(index) )
requestChannel.request({topic: 'test', data: 'foo'}).subscribe((data: number) => console.log(data));
wsJoinRoom.subscribe(function (message) { console.log(message); });
constructor( private afterStarterService: AfterStarterService, private daemonService: DaemonService ) { this.afterStarterService.appStarted.subscribe(() => this.daemonService.notifyDaemon() ); }
async register() { await Container.set(OrbitDb, new orbitDb(this.ipfs)); const odbContainer: OrbitDb = Container.get(OrbitDb); this.exitHandlerService.errorHandler.subscribe(() => { odbContainer.stop(); odbContainer.disconnect(); }); }
// subscriber 1 subject.subscribe((data) => { console.log(data); // 0.24957144215097515 (random number) });
// subscriber 1 subject.subscribe((data) => { console.log(data); // 0.24957144215097515 (random number) });
// subscriber 2 subject.subscribe((data) => { console.log(data); // 0.24957144215097515 (random number) });
// subscriber 2 subject.subscribe((data) => { console.log(data); // 0.24957144215097515 (random number) });