useInteger

UseIntegerExample

src/prod/numbers/useInteger.ts

import React from 'react';



export const useInteger = (intialState = 0) => {
	const [integer, setInteger] = React.useState(intialState);

	const setIntegerSafe = (x: number) => {
		setInteger(x);
	};

	return [integer, setIntegerSafe];
};

dist/prod/numbers/useInteger.js

import React from 'react';
export const useInteger = (intialState = 0) => {
    const [integer, setInteger] = React.useState(intialState);
    const setIntegerSafe = (x) => {
        setInteger(x);
    };
    return [integer, setIntegerSafe];
};

src/prod/numbers/useInteger.ts

import React from 'react';



export const useInteger = (intialState = 0) => {
	const [integer, setInteger] = React.useState(intialState);

	const setIntegerSafe = (x: number) => {
		setInteger(x);
	};

	return [integer, setIntegerSafe];
};