-
-
Notifications
You must be signed in to change notification settings - Fork 43
Fix angular input + API consistency #161
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
base: main
Are you sure you want to change the base?
Changes from all commits
dd30751
d6696fe
adf8714
c14701d
a816fbc
c8d1f5f
e2eb851
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@tanstack/angular-pacer': minor | ||
| --- | ||
|
|
||
| injectQueuedValue returns queued value instead of array |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ Defined in: [angular-pacer/src/queuer/injectQueuedSignal.ts:7](https://github.co | |
| ### addItem() | ||
|
|
||
| ```ts | ||
| addItem: (item, position?, runOnItemsChange?) => boolean; | ||
| addItem: (item, position, runOnItemsChange) => boolean; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Implementation (defaulted params) ==="
sed -n '401,408p' packages/pacer/src/queuer.ts
sed -n '6,12p' packages/angular-pacer/src/queuer/injectQueuedSignal.ts
echo
echo "=== Current docs (required params) ==="
rg -n -C2 'addItem: \(item, position, runOnItemsChange\) => boolean;|##### position\??|##### runOnItemsChange\??' \
docs/framework/angular/reference/interfaces/QueuedSignal.mdRepository: TanStack/pacer Length of output: 765 Update TypeScript signature and parameter headers to reflect optional parameters with defaults. Line 36 documents Suggested doc correction-addItem: (item, position, runOnItemsChange) => boolean;
+addItem: (item, position?, runOnItemsChange?) => boolean;
-##### position
+##### position?
-##### runOnItemsChange
+##### runOnItemsChange?Also applies to: lines 58-64 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| Defined in: [angular-pacer/src/queuer/injectQueuedSignal.ts:8](https://github.com/TanStack/pacer/blob/main/packages/angular-pacer/src/queuer/injectQueuedSignal.ts#L8) | ||
|
|
@@ -55,13 +55,13 @@ queuer.addItem('task2', 'front'); | |
|
|
||
| `TValue` | ||
|
|
||
| ##### position? | ||
| ##### position | ||
|
|
||
| `QueuePosition` | ||
| `QueuePosition` = `...` | ||
|
|
||
| ##### runOnItemsChange? | ||
| ##### runOnItemsChange | ||
|
|
||
| `boolean` | ||
| `boolean` = `true` | ||
|
|
||
| #### Returns | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| id: QueuedValueSignal | ||
| title: QueuedValueSignal | ||
| --- | ||
|
|
||
| # Interface: QueuedValueSignal()\<TValue, TSelected\> | ||
|
|
||
| Defined in: [angular-pacer/src/queuer/injectQueuedValue.ts:7](https://github.com/TanStack/pacer/blob/main/packages/angular-pacer/src/queuer/injectQueuedValue.ts#L7) | ||
|
|
||
| ## Type Parameters | ||
|
|
||
| ### TValue | ||
|
|
||
| `TValue` | ||
|
|
||
| ### TSelected | ||
|
|
||
| `TSelected` = \{ | ||
| \} | ||
|
|
||
| ```ts | ||
| QueuedValueSignal(): TValue; | ||
| ``` | ||
|
|
||
| Defined in: [angular-pacer/src/queuer/injectQueuedValue.ts:8](https://github.com/TanStack/pacer/blob/main/packages/angular-pacer/src/queuer/injectQueuedValue.ts#L8) | ||
|
|
||
| ## Returns | ||
|
|
||
| `TValue` | ||
|
|
||
| ## Properties | ||
|
|
||
| ### addItem() | ||
|
|
||
| ```ts | ||
| addItem: (item, position, runOnItemsChange) => boolean; | ||
| ``` | ||
|
|
||
| Defined in: [angular-pacer/src/queuer/injectQueuedValue.ts:9](https://github.com/TanStack/pacer/blob/main/packages/angular-pacer/src/queuer/injectQueuedValue.ts#L9) | ||
|
|
||
| Adds an item to the queue. If the queue is full, the item is rejected and onReject is called. | ||
| Items can be inserted based on priority or at the front/back depending on configuration. | ||
|
|
||
| Returns true if the item was added, false if the queue is full. | ||
|
|
||
| Example usage: | ||
| ```ts | ||
| queuer.addItem('task'); | ||
| queuer.addItem('task2', 'front'); | ||
| ``` | ||
|
Comment on lines
+46
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This interface documents ✏️ Suggested doc fix Example usage:
```ts
-queuer.addItem('task');
-queuer.addItem('task2', 'front');
+queued.addItem('task')
+queued.addItem('task2', 'front')🤖 Prompt for AI Agents |
||
|
|
||
| #### Parameters | ||
|
|
||
| ##### item | ||
|
|
||
| `TValue` | ||
|
|
||
| ##### position | ||
|
|
||
| `QueuePosition` = `...` | ||
|
|
||
| ##### runOnItemsChange | ||
|
|
||
| `boolean` = `true` | ||
|
|
||
| #### Returns | ||
|
|
||
| `boolean` | ||
|
|
||
| *** | ||
|
|
||
| ### queuer | ||
|
|
||
| ```ts | ||
| queuer: AngularQueuer<TValue, TSelected>; | ||
| ``` | ||
|
|
||
| Defined in: [angular-pacer/src/queuer/injectQueuedValue.ts:10](https://github.com/TanStack/pacer/blob/main/packages/angular-pacer/src/queuer/injectQueuedValue.ts#L10) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,21 @@ | ||
| // @ts-check | ||
|
|
||
| import rootConfig from '../../eslint.config.js' | ||
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url)) | ||
|
|
||
| /** @type {import('eslint').Linter.Config[]} */ | ||
| export default [...rootConfig] | ||
| export default [ | ||
| ...rootConfig, | ||
| { | ||
| name: 'angular-pacer/typescript-projects', | ||
| files: ['**/*.ts'], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: ['./tsconfig.lib.json', './tsconfig.spec.json'], | ||
| tsconfigRootDir, | ||
| }, | ||
| }, | ||
| }, | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: TanStack/pacer
Length of output: 780
Mark
positionandrunOnItemsChangeparameters as optional in theaddItemtype signature and parameter documentation sections.Line 36 and lines 50-56 should use the optional parameter notation (
?) to match the default values in the implementation (packages/pacer/src/async-queuer.ts).Suggested fix
🤖 Prompt for AI Agents