Skip to content

Comments

Fix angular input + API consistency#161

Open
benjavicente wants to merge 6 commits intoTanStack:mainfrom
benjavicente:fix-angular-input
Open

Fix angular input + API consistency#161
benjavicente wants to merge 6 commits intoTanStack:mainfrom
benjavicente:fix-angular-input

Conversation

@benjavicente
Copy link

@benjavicente benjavicente commented Feb 22, 2026

🎯 Changes

This PR does 2 things, both in injectQueuedValue:

  • value could be called on component initialization, causing injectQueuedValue to throw. I added a tests first to demonstrate the issue and then I added a commit to fix it. There was an example that tested against that error, but where the path where of the value() call wasn't reached (maybeSelector is not undefined).

    protected readonly queued = injectQueuedValue(this.value, null, { wait: 500 }, (state) => ({
    items: state.items,
    }))
    >(
    value: Signal<TValue>,
    initialValueOrOptions?: TValue | QueuerOptions<TValue>,
    initialOptionsOrSelector?:
    | QueuerOptions<TValue>
    | ((state: QueuerState<TValue>) => TSelected),
    maybeSelector?: (state: QueuerState<TValue>) => TSelected,
    ): QueuedSignal<TValue, TSelected> {
    const hasSelector = typeof initialOptionsOrSelector === 'function'
    const hasInitialValue =
    (initialOptionsOrSelector !== undefined && !hasSelector) ||
    maybeSelector !== undefined
    const initialValue = hasInitialValue
    ? (initialValueOrOptions as TValue)
    : value()

  • The injectQueuedValue was returning an array instead of a queued value. I guess that was a mistake, so I aligned the function to behave similar to the React api.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@changeset-bot
Copy link

changeset-bot bot commented Feb 22, 2026

🦋 Changeset detected

Latest commit: c8d1f5f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/angular-pacer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjavicente benjavicente marked this pull request as ready for review February 22, 2026 21:12
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.

1 participant