Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No ability to have multiple instances of RxPaper #12

Closed
Trikke opened this issue Oct 19, 2016 · 2 comments
Closed

No ability to have multiple instances of RxPaper #12

Trikke opened this issue Oct 19, 2016 · 2 comments

Comments

@Trikke
Copy link

Trikke commented Oct 19, 2016

RxPaper contains 2 static fields to hold the instances of the current RxPaper and custom book you'd be using.

private static RxPaper mRxPaper;
private static String sCustomBook;

There are 2 issues with this setup which both relate to having multiple custom books (or preferably, instances of RxPaper)

Problem 1:

RxPaper.book("custom-book1").read(...)
RxPaper.book("custom-book2").read(...)
RxPaper.book("custom-book1").read(...)

This will instantiate 3 instances on RxPaper (3x overriding the same static field). So if i use 2 custom books i will create a lot of useless instances.

Problem 2:

I can not have multiple classes which each have a separate RxPaper with a custom book because of the above. The last class create will determine which custom book the will all share.

@Trikke
Copy link
Author

Trikke commented Oct 19, 2016

I created a pull request for this.

@cesarferreira
Copy link
Owner

@Trikke super sorry for the late response, i was unsubscribed to this repo, dunno why, will check it out now

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

No branches or pull requests

2 participants