This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@us3r-network/thread
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@us3r-network/thread

The @us3r-network/thread package provides some easy ways to create thread, and some options with thread, like comment,vote,favor,score.

Install

npm i @us3r-network/thread

Usage

Wrapper app with Us3rThreadProvider, Us3rThreadProvider provides threadComposeClient relationsComposeClient witch communication with Ceramic. The methods like getThreadInfo createNewComment createNewFavor createNewVote createNewScore can create the comment vote in ceramic.

...
import { Us3rProfileProvider } from "@us3r-network/profile";
import { Us3rThreadProvider } from "@us3r-network/thread";

...

const ceramicHost =
  process.env.REACT_APP_CERAMIC_HOST || "http://13.215.254.225:7007";
...
    <Us3rProfileProvider ceramicHost={ceramicHost}>
      <Us3rThreadProvider ceramicHost={ceramicHost}>
        <App>
      </Us3rThreadProvider>
    </Us3rProfileProvider>
...
...
  const { sessId, profile, connectUs3r, us3rAuth, us3rAuthValid } =
    useUs3rProfileContext()!;
  const { threadComposeClient, relationsComposeClient } =
    useUs3rThreadContext()!;

  const authComposeClients = useCallback(() => {
    if (us3rAuthValid && us3rAuth.valid) {
      us3rAuth.authComposeClients([
        threadComposeClient,
        relationsComposeClient,
      ]);
    }
  }, [relationsComposeClient, threadComposeClient, us3rAuth, us3rAuthValid]);
...
...
  const {
    getThreadInfo,
    createNewComment,
    createNewFavor,
    createNewVote,
    createNewScore,
  } = useUs3rThreadContext()!;
...

In order to express how to use it more clearly, we have prepared a demo

Readme

Keywords

none

Package Sidebar

Install

npm i @us3r-network/thread

Weekly Downloads

3

Version

0.3.0

License

MIT

Unpacked Size

211 kB

Total Files

27

Last publish

Collaborators

  • d_ttang
  • friendlysxw
  • hulk23
  • sin_bufan
  • us3rnetwork