mcxiaoke / rxdocs Goto Github PK
View Code? Open in Web Editor NEWRx和RxJava文档中文翻译项目
Home Page: http://mcxiaoke.gitbooks.io/rxdocs/content/
Rx和RxJava文档中文翻译项目
Home Page: http://mcxiaoke.gitbooks.io/rxdocs/content/
2.0版本已经发布了,有没有计划对2.0进行翻译?
toFuture 操作符也是---->toIterable操作符也是
我们建立了一个新的社区Kotlin China,请问能否让我们以精品专题形式,转载该项目下的文章。我们将标明原项目地址和作者和项目贡献者,同时期待您的加入。该项目地址, 服务使用kotlin编写构建
官方文档原文:
takeWhile( ) and takeWhileWithIndex( ) — emit items emitted by an Observable as long as a specified condition is true, then skip the remainder
文章当中的翻译:
takeWhile( ) and takeWhileWithIndex( ) — 发射原始Observable的数据,直到一个特定的条件为真,然后跳过剩余的数据
我认为应该翻译成-发射原始Observable的数据,只要这个条件为真,如果这个条件为假,那就跳过它及它之后剩余的数据。这里的 'as long as'是'只要'的意思,而不是'直到'。
测试代码:
Observable.just(1, 2, 3, 4, 5) .takeWhile(number -> number != 3) .subscribe(number -> System.out.println(number));
输出:
1 2
你也可以传递一个Observer给 doOnEach,,, 这样才对啊,大神,印刷错误
Scan操作符会从第二项数据开始应用函数,当只有一个数据时不会应用函数。函数的第一个参数为第一项数据或上次函数的返回值,第二个参数为当前要处理的数据。
Observable<Integer> scan = Observable.just(1,2,3,4,5).scan(new Func2<Integer, Integer, Integer>(){
@Override
public Integer call(Integer t1, Integer t2) {
System.err.println("t1="+t1+"--t2="+t2);
return t2+2;
}
});
Subscriber subscriber = new Subscriber<T>(){
@Override
public void onStart() {
System.err.println("onStart: ");
}
@Override
public void onCompleted() {
System.err.println("Completed!");
}
@Override
public void onError(Throwable thrwbl) {
System.err.println("Error!"+thrwbl.getMessage());
}
@Override
public void onNext(T s) {
System.err.println("Item: " +s.getClass()+"="+ s);
}
};
scan.subscribe(subscriber);
输出:
onStart:
Item: class java.lang.Integer=1
t1=1--t2=2
Item: class java.lang.Integer=4
t1=4--t2=3
Item: class java.lang.Integer=5
t1=5--t2=4
Item: class java.lang.Integer=6
t1=6--t2=5
Item: class java.lang.Integer=7
如题。
doOnUnsubscribe 操作符注册一个动作,当观察者取消订阅它生成的Observable它就会被调
用。
doOnSubscribe 操作符注册一个动作,当观察者订阅它生成的Observable它就会被调用。
描述错误啊。。
正常:
doOnUnsubscribe 操作符注册一个动作,当观察者取消订阅Observable,它就会被调
用。
doOnSubscribe 操作符注册一个动作,当观察者订阅Observable,它就会被调用。
6.2.1章节中的buffer(bufferOpenings, bufferClosingSelector)小节里:
每当bufferOpenings发射了一个数据时,它就创建一个新的List开始手机原始Observable的数据,并将bufferOpenings传递给closingSelector函数。
手机二字编写错误
Define a method that does something useful with the return value from the asynchronous call; this method is part of the observer.
目前的翻译为:
定义一个方法,它完成某些任务,然后从异步调用中返回一个值,这个方法是观察者的一部分。
更合理的翻译建议:
定义一个方法,这个方法拿着某个异步调用的返回值做一些有用的事情。这个方法是观察者的一部分。
不知道,大家考虑到,没有,文中对于方法使用 <操作符>来描述,对于,新接触的人来说,一时之间有点难以绕过弯,建议把操作符换成,方法,这样不是更容易理解吗!还有如何加入,这个翻译组,
但是我在1.1.0的版本并没有啊
6.8节==>其他聚合操作符==>reduce( ) — 对序列使用reduce()函数并发射对吼的结果
其中“并发送对吼结果” 这句是否有问题? 是不是应该改为“发射最终的结果”
RxJava更新到3.0都没看到这几个操作符
timeout()
没有空参方法
在 create 操作符中有这么一段描述
建议你在传递给 create 方法的函数中检查观察者的 isUnsubscribed 状态,以便在没有观察者
的时候,让你的Observable停止发射数据或者做昂贵的运算。
是不是可以理解为,在没有观察者的时候,被观察者依然会调用call方法并执行里边的操作?我编写了一段代码发现并没有执行啊是我的理解有错误吗?烦请解释下
代码如下
Observable observable1 = Observable.create(subscriber -> {
subscriber.onNext(str);
for (int i = 0; i < 10; i++) {
Log.d("debug create","using call "+i);
}
});
//发现并没有调用
今天查资料到Rx官网上逛了一圈,发现了一个很有意思的东西,在他们简介的页面新增了这样一段话
It is sometimes called “functional reactive programming” but this is a misnomer. ReactiveX may be functional, and it may be reactive, but “functional reactive programming” is a different animal. One main point of difference is that functional reactive programming operates on values that change continuously over time, while ReactiveX operates on discrete values that are emitted over time.
他们否认了Rx是“函数响应式编程”,对于这点应该怎么看?
大小写错误导致404
新手。这不是rx2吧?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.