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

Add Reset Field to getRemaining #113

Merged
merged 5 commits into from
Jul 8, 2024
Merged

Add Reset Field to getRemaining #113

merged 5 commits into from
Jul 8, 2024

Conversation

CahidArda
Copy link
Contributor

@CahidArda CahidArda commented Jul 2, 2024

With this change, we update the getRemaining method like:

-  public getRemaining = async (identifier: string): Promise<number> => {
+  public getRemaining = async (identifier: string): Promise<{
+    remaining: number;
+    reset: number;
+  }> => {

We essentially update the returned object from a number to a dictionary with remaining and reset time information.

Number of commands executed doesn't change.

Addresses #111

Copy link

linear bot commented Jul 2, 2024

Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ratelimit-with-vercel-kv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 1:52pm

@fahreddinozcan
Copy link
Contributor

Also, we can add some comments related to reset being a timestamp in the code, which would make it easier to reason

src/single.ts Outdated Show resolved Hide resolved
@CahidArda
Copy link
Contributor Author

added packageManager to kv-with-vercel example package.json to resolve this issue

@CahidArda CahidArda merged commit a239d58 into main Jul 8, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants