Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Code simplification #1741

Open
BAKFR opened this issue Oct 16, 2018 · 0 comments
Open

Code simplification #1741

BAKFR opened this issue Oct 16, 2018 · 0 comments

Comments

@BAKFR
Copy link
Contributor

BAKFR commented Oct 16, 2018

What's the point of using an EventEmitter in the engine ?

zenbot/boot.js

Lines 37 to 38 in 6c92f2b

var eventBus = new EventEmitter()
zenbot.conf.eventBus = eventBus

zenbot/lib/engine.js

Lines 22 to 24 in 6c92f2b

let eventBus = conf.eventBus
eventBus.on('trade', queueTrade)
eventBus.on('trades', onTrades)

There are 3 events: trades, trade and orderExecuted.
The trades event is not used anywhere and can be removed.
Both trade and orderExecuted have only one listening function and could be replaced by a direct call to these functions.

Am I missing something ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants