Before:
ParseUser.getQuery().findInBackground(new FindCallback() {
@Override
public done(ParseUser user, ParseException e) {
if (e == null) System.out.println(user));
}
});
After:
Observable<ParseUser> users = ParseObservable.from(ParseUser.class).find();
users.subscribe(user -> System.out.println(user.getObjectId()));
Observable<ParseUser> users = ParseObservable.from(ParseUser.class).find(ParseUser.getQuery().setLimit(1000));
Before:
ParseUser.getQuery().countInBackground(new CountCallback() {
@Override
public done(int count, ParseException e) {
if (e == null) System.out.println(count));
}
});
After:
Observable<Integer> count = ParseObservable.from(ParseUser.class).count();
count.subscirbe(c -> System.out.println(c));
Observable<ParseUser> loginUser = ParseObservable.loginWithFacebook(activity);
Before:
ParseUser.getQuery().fetchIfNeededInBackground(new GetCallback() {
@Override
public done(ParseUser user, ParseException e) {
if (e == null) System.out.println(user));
}
});
After:
ParseObservable.fetchIfNeeded(user)
.subscribe(user -> System.out.println(user));
Before:
user.pinInBackground(new SaveCallback() {
@Override
public done(ParseException e) {
// ...
}
});
After:
ParseObservable.pin(user)
.subscribe(user -> System.out.println(user));
Before:
ParseObject.pinAllInBackground(users, new SaveCallback() {
@Override
public done(ParseException e) {
// ...
}
});
After:
ParseObservable.pin(users)
.subscribe(user -> System.out.println(user));
Before:
user.saveInBackground(new SaveCallback() {
@Override
public done(ParseException e) {
// ...
}
});
After:
ParseObservable.save(user)
.subscribe(user -> System.out.println(user));
via jcenter
repositories {
jcenter()
}
dependencies {
compile 'com.infstory:rxparse:1.0.0'
}
Or via jitpack.io
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.yongjhih:rxparse:1.0.0'
}
Copyright 2015 8tory, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.