0.2.4 • Published 3 years ago

immo-react-statistic v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

IMMO React statistic sender

Install

$ yarn add immo-react-statistic

Examples

Use as component

import Statistic from 'immo-react-statistic';

// inside your component return

const App = () => (
        <BrowserRouter>
            <Statistic path="/referer/statistic" headers={{ someHeader: true }} />
            <Routes />
        </BrowserRouter>
    );

Use as hook

import { useStatistic } from 'immo-react-statistic';

const Component = () => {
    useStatistic({
        path: '/referer/statistic',
        headers: {
            someHeader: true
        }
    });

    return <div>Text</div>;
};

export default Component;

Use as HOC

import { withStatistic } from 'immo-react-statistic';

const Component = () => {
    return <div>Text</div>;
};

const params = {
    path: '/referer/statistic',
    headers: {
        someHeader: true
    }
};

export default withStatistic(Component, params);

Headers param is optional.

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago