@naporin0624/react-flowder
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

react-flowder

A library that connects rxjs to React and uses suspense to load data on the first subscribe.

505d0082dcff533299cb631f616f1cd5

Usage

import React, { Suspense } from "react";
import { render } from "react-dom";
import { interval } from "rxjs";
import { datasource, useReadData, Provider } from "@naporin0624/react-flowder";

const timer = datasource(() => interval(1000));

const Timer = () => {
  const time = useReadData(timer());

  return (
    <div>
      <p>time: {time}</p>
    </div>
  );
};

const App = () => (
  <Provider>
    <Suspense fallback={<p>loading</p>}>
      <Timer />
    </Suspense>
  </Provider>
);

export default App;

LICENSE

MIT

Package Sidebar

Install

npm i @naporin0624/react-flowder

Weekly Downloads

0

Version

3.3.0

License

MIT

Unpacked Size

39.3 kB

Total Files

11

Last publish

Collaborators

  • naporin0624