RxJS integration package for ProppyJS
With npm:
$ npm install --save proppy rxjs proppy-rx
Via unpkg CDN:
<script src="https://unpkg.com/proppy@latest/dist/proppy.min.js"></script>
<script src="https://unpkg.com/proppy-rx@latest/dist/proppy-rx.min.js"></script>
<script>
// available as `window.ProppyRx`
</script>
With the withStream
function, you can map an incoming stream of props and return a new stream:
import { compose, withProps } from 'proppy';
import { withStream } from 'proppy-rx';
import { map } from 'rxjs/operators';
const P = compose(
withProps({ foo: 'foo value' }),
withStream((props$, providers) => {
// `props$` is an Observable here
// let's now return a stream of props here
return props$.pipe(
map(props => props),
);
}),
);
You can also convert your instance to a props stream using RxJS:
import { from } from 'proppy-rx';
const props$ = from(p);
withStream((props$, providers) => props$)
Used for taking an incoming stream of props, and returning a new stream.
from(p)
Returns an Observable of props.