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

How to createData when data is null #143

Open
HuuNguyen312 opened this issue Jul 2, 2019 · 0 comments
Open

How to createData when data is null #143

HuuNguyen312 opened this issue Jul 2, 2019 · 0 comments

Comments

@HuuNguyen312
Copy link

Hi @codeestX

    public static <T> Flowable<T> createData(final T t) {
        return Flowable.create(new FlowableOnSubscribe<T>() {
            @Override
            public void subscribe(FlowableEmitter<T> emitter) throws Exception {
                try {
                    emitter.onNext(t);
                    emitter.onComplete();
                } catch (Exception e) {
                    emitter.onError(e);
                }
            }
        }, BackpressureStrategy.BUFFER);
    }

For example: server response:
{
"code": 200,
"data": null
}

How to createData with "data" is null?
Please help me reslove it.

Thanks

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

1 participant