Files
17d7a8be6a refactor(deps): migrate from archived tslint to eslint (#509)
* Install ESLint

Signed-off-by: Sosuke Suzuki <[email protected]>

* Add `.eslintrc.json`

Signed-off-by: Sosuke Suzuki <[email protected]>

* Follow ESLint rules

Signed-off-by: Sosuke Suzuki <[email protected]>

* Remove tslint

Signed-off-by: Sosuke Suzuki <[email protected]>

* Remove tslint.json

Signed-off-by: Sosuke Suzuki <[email protected]>

* Remove tslint.json

Signed-off-by: Sosuke Suzuki <[email protected]>

* Fix lint problem

Signed-off-by: Sosuke Suzuki <[email protected]>

* Set `node-version-file` for `setup-node`

Signed-off-by: Sosuke Suzuki <[email protected]>

* build(deps): update to latest node v14

- node v14 is EoL and has been since April 2023: https://github.com/nodejs/Release/blob/68840fae8fdaa59bf9431661238dbb86b4390829/README.md?plain=1#L7
  - but this is the least intrusive update for now that gets build passing
  - will further update node in a separate PR

Signed-off-by: Anton Gilgur <[email protected]>

---------

Signed-off-by: Sosuke Suzuki <[email protected]>
Signed-off-by: Sosuke Suzuki <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Co-authored-by: Sosuke Suzuki <[email protected]>
Co-authored-by: Sosuke Suzuki <[email protected]>
2024-02-13 10:12:53 -05:00

23 lines
535 B
TypeScript

import * as React from 'react';
import {Ticker} from './ticker';
export default {
component: Ticker,
title: 'Components/Ticker',
argTypes: {
value: {control: {type: 'number'}},
},
};
export const Primary = () => {
const [randVal, setRandVal] = React.useState(0);
React.useEffect(() => {
const to = setTimeout(() => {
setRandVal(Math.round((Math.random() * 10) % 10));
return () => clearInterval(to);
}, 2000);
});
return <Ticker value={randVal} />;
};