react-stream-builder
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-stream-builder

A React Component that builds itself based on the latest snapshot emitted by an Observable.

Usage

Install the following npm package: https://www.npmjs.com/package/react-stream-builder

Example

See ./example for a minimal example.

        <StreamBuilder
          stream={this.props.count}
          builder={(snapshot: Snapshot<number>) => {
            // If the observable has not yet emitted any values print a message
            // indicating that we're still waiting.
            if (snapshot.state !== ConnectionState.active) {
              return "Loading...";
            }
 
            return `Count is now ${snapshot.data}`;
          }}
        />

Readme

Keywords

Package Sidebar

Install

npm i react-stream-builder

Weekly Downloads

0

Version

0.1.1

License

Apache-2.0

Unpacked Size

102 MB

Total Files

13779

Last publish

Collaborators

  • simonhorlick