1.0.3 • Published 8 years ago
@owsas/pubnub-react-counter v1.0.3
pubnub-react-counter
Count how many people are present in one pubnub channel with React.
Demo

Usage
import React from 'react';
import { render } from 'react-dom';
import PubNub from 'pubnub';
import Index from '../src/index';
const pubnub = new PubNub({
publishKey: 'demo',
subscribeKey: 'demo',
ssl: true,
});
render(<p><Index channel="test-channel" pubnub={pubnub} /> visitor(s)</p>, document.getElementById('root'));Dev Mode
- Clone this repository
- Run
yarn install(Usage of Yarn is recommended) - Edit the
src/index.jsxfile and then runnpm run dev. - This will start the
webpack-dev-server - Then open your browser at
localhost:3200 - The browser will be updated everytime you change the code at
src/index.jsx
Dev Features
- Linting with eslint
- Linting code style: Airbnb
- Testing with
jest@^21.2.1andenzyme@^3.1.1 - Uses
babelfor JS transpiling - Uses
webpackfor building the code
Folder structure
/src: The module code/test: The tests for thesrccomponents/build: The target compilation directory
Credits
Juan Camilo Guarín Peñaranda
Otherwise SAS
Cali, Colombia, 2017
License
MIT
