TanStack / TanStack/pacer

Allow reactive options in signal based adapters

Open
#162 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
769
Forks
64
Avg merge
1d 21h
Merged PRs (30d)
3

Description

TanStack Pacer version

0.19.0

Framework/Library version

Solid, Angular

Describe the bug and the steps to reproduce it

In the React adapter, options for pacer APIs are reactive, and update when the given options object change.

But in Solid and Angular, the APIs accept only a object as an argument, and since those functions only run once, there is no way the adapter can update the options by itself like React. In other libraries, like query and hotkeys, options allow (or are given only by) a function in the signal based adapters (Solid, Angular, etc).

This can be annoying in some cases in Angular, since input signals can't be read on initialization, so there would be no simple way to use any of pacer APIs when the options depend on the component inputs.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

No repo since this is a behaviour issue. Here are links to the code for rate limiter, where react updates the options but the other adapters do not: React, Solid, Angular. Note that only React calls setOptions.

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the linked rate-limiter entry points in packages/react-pacer/src/rate-limiter/useRateLimiter.ts, packages/solid-pacer/src/rate-limiter/createRateLimiter.ts, and packages/angular-pacer/src/rate-limiter/injectRateLimiter.ts. Trace how React updates options and determine the corresponding reactive behavior needed for the signal-based adapters; done means changing options works for Solid and Angular use cases described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.