react-dibs
v0.6.8
Published
dibs react client higher order component
Downloads
8
Readme
react-dibs
I call Dibs!
react-dibs is the client component for Dibs
API
PropTypes
react-dibs
exposes a render props component that needs the following props:
server: string
the address of the dibs server (there is one currently live on staging,https://dibs.test.tvlk.cloud
)username: string
for tools with auth0, you can fill this withstate.oidc.token.userEmail
Render props
And it will provides a render props which consists of:
pageVisitorList: array
list of users that currently opening the same page as you, sorted by the first one to visit . For further explanation, please check Dibs's documentation
Getting started
- Install
yarn add react-dibs
- Import
import CallDibs from 'react-dibs';
...
render() {
return (
<CallDibs
server={serverAddress}
username={userEmail}
>
{info => console.log(info)} // { pageVisitorList: [] }
</CallDibs>
);
}