Rxjs - Operators - Concat Posted on 2016-05-17 | In RxJS Signatureexport declare function concat<T, R>(...observables: Array<ObservableInput<any> | Scheduler>): Observable<R>; 接受多个流- ... Read more »
Rxjs - Operators - StartWith Posted on 2016-05-16 | In RxJS startWith可以作为一种默认初始值的用法 当然因为可以在流前面插入多个值,所以这个operator比单纯初始值更强大 var source = Rx.Observable.return(4) .startWith(1, 2, 3)var subscription = source.sub ... Read more »
Rxjs - Operators - Partition Posted on 2016-05-16 | In RxJS 上一篇写的If,听起来很像我们常用的 那个相当于 条件符合 就赋值的情况,就是处理的是 数据源的判断 这次看的更像 if()else() Signatureexport declare function partition<T>(predicate: (value: T) => b ... Read more »
Rxjs - Operators - If Posted on 2016-05-16 | In RxJS If 从jq习惯直转为FP的必须的思路转化 Signatureconstructor(condition: () => boolean | void, thenSource?: SubscribableOrPromise<T> | void, elseSource?: Subscr ... Read more »
Rxjs - Operators - Last Posted on 2016-05-16 | In RxJS Last和first一起,好理解了但是,既然要最后一个符合条件的.那就是说.你的流要complete才知道结果 var source = Rx.Observable.range(0, 10). last( function (v, index, obs) { return v ... Read more »
Rxjs - Operators - First Posted on 2016-05-16 | In RxJS 因为最近看Haskell, 开头收head tail 什么.所以顺便想看看Rxjs里相关的operator Signaturepublic first( predicate: function(value: T, index: number, source: Observable<T&g ... Read more »
Rxjs - Operators - Count Posted on 2016-05-12 | In RxJS 这个要写一下,因为被自己坑了.之前写分页的时候,忘记当时想法了,想用这个count的operator.但不管怎么do啊 subscribe 啊 都不输出值,各种郁闷.后来想了半天,找到怀疑对象. Completed 看文档吧,更详细 Rx.Observable.prototype.count([pr ... Read more »
Rxjs - ngPagination Posted on 2016-05-12 | In RxJS 由于群里很多人问 NG2 分页怎么做.我在这里做个 demo 基本组件结构主路由组件 注入 service providers: [ROUTER_PROVIDERS, PagerService, HTTP_PROVIDERS] 组件主体分为 list footer <app-test-li ... Read more »
React-Router - Dynamic Routing Posted on 2016-05-04 | In React , React-Router 动态加载,就是避免一次性都加载很多模块 render(( <Router history={hashHistory}> <Route path="/" component={App}> < ... Read more »
React-Router - Index Routes and Index Links Posted on 2016-05-04 | In React , React-Router IndexRoute 默认子路由当跳转到父路径的时候,这个默认组件自动render <Router> <Route path="/" component={App}> <IndexRoute component={Home} ... Read more »