Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useNumber increase with loop works unexpected. #54

Closed
logeast opened this issue Aug 24, 2020 · 1 comment · Fixed by #58
Closed

useNumber increase with loop works unexpected. #54

logeast opened this issue Aug 24, 2020 · 1 comment · Fixed by #58
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@logeast
Copy link

logeast commented Aug 24, 2020

When initial value isn't the lowerLimit, it works unexpected.

Maybe it works well for this code. When nextValue > upperLimit and if loop, it will return lowerLimit but not initial value.

// src/array/useNumber.ts
//...
        if (upperLimit !== undefined) {
          if (nextValue > upperLimit) {
            if (loop) {
              return lowerLimit;
            }
            return upperLimit;
          }
        }

        return nextValue;
      });
    },
    [lowerLimit, loop, step, upperLimit],
  );
@RIP21 RIP21 added bug Something isn't working good first issue Good for newcomers labels Aug 24, 2020
@RIP21 RIP21 closed this as completed in #58 Jan 27, 2021
@RIP21
Copy link
Collaborator

RIP21 commented Jan 27, 2021

Released in v2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants