0.5.5 • Published 9 months ago

@b3w/react-statistic v0.5.5

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

b3w React statistic sender

Install

$ yarn add @b3w/react-statistic

Examples

Use as component

import { Statistic } from '@b3w/react-statistic';

// inside your component return

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

Use as hook

import { useStatistic } from '@b3w/react-statistic';

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

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

export default Component;

Use as HOC

import { withStatistic } from '@b3w/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.5.4

9 months ago

0.5.3

9 months ago

0.5.5

9 months ago

0.5.2

9 months ago

0.5.1

9 months ago

0.5.0

11 months ago

0.4.4

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.3.5

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago