proppy-rx
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

proppy-rx

npm

RxJS integration package for ProppyJS


Guide

Installation

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> 

Usage

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),
    );
  }),
);

Interop with RxJS

You can also convert your instance to a props stream using RxJS:

import { from } from 'proppy-rx';
 
const props$ = from(p);

API

withStream

withStream((props$, providers) => props$)

Used for taking an incoming stream of props, and returning a new stream.

from

from(p)

Returns an Observable of props.

Readme

Keywords

Package Sidebar

Install

npm i proppy-rx

Weekly Downloads

8

Version

1.3.1

License

MIT

Unpacked Size

14.4 kB

Total Files

27

Last publish

Collaborators

  • fahad19