Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Reduce Trade dependencies #284

Merged
merged 2 commits into from
Sep 22, 2016
Merged

Reduce Trade dependencies #284

merged 2 commits into from
Sep 22, 2016

Conversation

Sjors
Copy link
Contributor

@Sjors Sjors commented Sep 22, 2016

I need to get rid of some circular dependencies in Trade. That should also make writing tests easier.

  • move .trades reference to delegate : avoids having to pass coinify.trades along to new Trade objects
  • pass save() method directly, or use delegate
  • remove trade._coinify

Also added more debug statements.

This avoids having to pass coinify.trades along to new Trade objects.
Also added more debug statements.
@Sjors
Copy link
Contributor Author

Sjors commented Sep 22, 2016

@jtormey with this first commit, I'm seeing a cannot find refresh() of undefined method when a payment is received, though everything seems to work. Can you try that on your end?

@jtormey
Copy link
Contributor

jtormey commented Sep 22, 2016

You don't need to do this.x.f.bind(this.x.f)(), only when the function is being separated from it's parent object.

OK: this.x.f()
NOT OK: funcWithCallback(this.x.f)
NOT OK: let callf = this.x.f

@jtormey jtormey merged commit 8d4c87c into master Sep 22, 2016
@jtormey jtormey deleted the trade-dependencies branch September 22, 2016 14:00
@Sjors
Copy link
Contributor Author

Sjors commented Sep 23, 2016

I should just migrate to ES6, so I don't have to think about this :-)

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

Successfully merging this pull request may close these issues.

2 participants