0.1.1 • Published 6 years ago

react-stream-builder v0.1.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

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}`;
          }}
        />
0.1.1

6 years ago

0.1.0

6 years ago