From 242fa9c8cf6e296fbd44a3316aeb413450fa9f66 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 3 Jun 2019 12:08:54 -0400 Subject: [PATCH] cleanup --- src/eventSyncer.js | 5 ++--- src/index.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/eventSyncer.js b/src/eventSyncer.js index 14900a0..3e96239 100644 --- a/src/eventSyncer.js +++ b/src/eventSyncer.js @@ -1,7 +1,6 @@ -const { Observable, fromEvent, interval, Subject, ReplaySubject } = require('rxjs'); -const { throttle, throttleTime, map, distinctUntilChanged, filter, average, reduce, count, scan } = require('rxjs/operators'); +const { fromEvent, interval, ReplaySubject } = require('rxjs'); +const { throttle, filter } = require('rxjs/operators'); const loki = require('lokijs') -//const db = new loki('loki.json', {autosave: true, autoload: true}) class EventSyncer { diff --git a/src/index.js b/src/index.js index 5605c30..e2847f7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,6 @@ // var Web3 = require('web3') const Events = require('events') -const { Observable, fromEvent, interval, Subject } = require('rxjs'); -const { throttle, throttleTime, map, distinctUntilChanged, filter, average, reduce, count, scan } = require('rxjs/operators'); +const { map, scan } = require('rxjs/operators'); const Simulator = require('./simulator.js') const EventSyncer = require('./eventSyncer.js') @@ -23,7 +22,7 @@ function run() { let mymap = map(arr => arr.reduce((acc, current) => acc + current, 0) / arr.length) eventSyncer.trackEvent('contractEvent', ((x) => x.from === "0x123")).pipe(map(x => x.rating), myscan, mymap).subscribe((v) => { - console.dir("current value is " + v) + console.dir("current average is " + v) }) const simulator = new Simulator(events);