react-rx 2.1.3 → 3.0.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +0,0 @@
1
- import * as React from 'react'
2
- import {Observable} from 'rxjs'
3
- import {map} from 'rxjs/operators'
4
- import {wrapDisplayName} from './displayName'
5
- import {reactiveComponent} from './reactiveComponent'
6
-
7
- type ObservableFactory<SourceProps, TargetProps> = (
8
- props$: Observable<SourceProps>,
9
- ) => Observable<TargetProps>
10
-
11
- /**
12
- * @deprecated Use reactiveComponent instead
13
- */
14
- export function withPropsStream<SourceProps, TargetProps>(
15
- observableOrFactory: Observable<TargetProps> | ObservableFactory<SourceProps, TargetProps>,
16
- TargetComponent: React.ComponentType<TargetProps>,
17
- ) {
18
- const ComposedComponent = reactiveComponent<SourceProps>(sourceProps$ => {
19
- const targetProps$ =
20
- typeof observableOrFactory === 'function'
21
- ? observableOrFactory(sourceProps$)
22
- : observableOrFactory
23
- return targetProps$.pipe(map(props => <TargetComponent {...props} />))
24
- })
25
- ComposedComponent.displayName = wrapDisplayName(TargetComponent, 'withPropsStream')
26
- return ComposedComponent
27
- }