rtc-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.16 • Public • Published

rtc-react

RTC React

NPM JavaScript Style Guide

Install

npm install --save rtc-react

Usage

import React from 'react'
import { RTC, CartDisplay } from 'rtc-react'

const Site : any = (props:any) => {
  React.useEffect(() => {
      props.rtcApi.loadCart({
        defaultVariantId: "40194513993914",
        defaultAddons: "39518515298490"
      });

  }, [ props.rtcApi]);

  return (
    <CartDisplay />
  );

}

const App = () => {

  const eventHandler = async(e:any) => {
    console.log(`custom event handler received: ${e.eventType}`);
  };

  return (
    <RTC component={Site}
         apiEndpoint="api.burnerdomain.rtccart.io"
         eventHandler={eventHandler}
    />
  );
}

export default App;

License

UNLICENSED © scaledfury

Readme

Keywords

none

Package Sidebar

Install

npm i rtc-react

Weekly Downloads

28

Version

1.0.16

License

UNLICENSED

Unpacked Size

551 kB

Total Files

136

Last publish

Collaborators

  • scaledfury