• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atomicpages / pretty-checkbox-react / 10633918906

30 Aug 2024 01:53PM UTC coverage: 100.0%. Remained the same
10633918906

Pull #1156

github

web-flow
build(deps): bump micromatch from 4.0.4 to 4.0.8 in /docs

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.4 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.4...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #1156: build(deps): bump micromatch from 4.0.4 to 4.0.8 in /docs

67 of 67 branches covered (100.0%)

Branch coverage included in aggregate %.

172 of 172 relevant lines covered (100.0%)

9.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/components/radio/useRadioState.ts
1
import * as React from 'react';
2✔
2

3
export type UseRadioState = {
4
  state?: boolean | string;
5
  onChange?: React.InputHTMLAttributes<HTMLInputElement>['onChange'];
6
};
7

8
export const useRadioState = ({
2✔
9
  state: initialState = false,
8✔
10
  onChange,
11
}: UseRadioState = {}) => {
12
  const [state, setState] = React.useState(initialState);
8✔
13

14
  return {
8✔
15
    state,
16
    setState,
17
    onChange: React.useCallback(
18
      (e: React.ChangeEvent<HTMLInputElement>) => {
19
        const { value } = e.currentTarget;
4✔
20

21
        setState((current) => {
4✔
22
          if (value !== '') {
4✔
23
            return value;
1✔
24
          }
25

26
          return !current;
3✔
27
        });
28

29
        if (typeof onChange === 'function') {
4✔
30
          onChange(e);
2✔
31
        }
32
      },
33
      [onChange]
34
    ),
35
  };
36
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc