0.3.0 • Published 5 years ago

adom-client v0.3.0

Weekly downloads
151
License
-
Repository
github
Last release
5 years ago

adom-client

Adom client library

Adom Wrapper

Create an adom wrapper component.

import { AdomClient, AdomProvider, ThemeProvider } from 'adom-client';
const adomClient = new AdomClient(<ADOM_DOCKER_HOST>, <ADOM_DOCKER__PORT>);

const AdomWrapper = ({children}) => {
    return(
        <ThemeProvider>
            <AdomProvider client={adomClient}>
                {children}
            </AdomProvider>
        </ThemeProvider>
    )
}

Use adom context

Get context of AdomProvider

import { useAdom } from 'adom-client';

const AssistedContainer = ({children}) => {
    const adomContext = useAdom();
    return (
        <Assisted>
            <React.Fragment>
                {!!adomContext.initialize &&
                    <button onClick={init}>
                        Start call
                    </button>
                }
                <button onClick={hangUp}>
                    Hang up
                </button>
                {!!adomContext.peerID &&
                    <div>
                        PEER_ID => {adomContext.peerID}
                    </div>
                }
            </React.Fragment>
        </Assisted>
    )
}

Guide to create react library

https://hackernoon.com/creating-a-library-of-react-components-using-create-react-app-without-ejecting-d182df690c6b

Develop library locally

  • On root folder launch these commands: npm run build
    npm link
  • Use this linked library in other project: npm link adom-client

This project was bootstrapped with Create React App.

0.3.0

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago