Skip to content

Test that dispatchers stay reactive with signal-backed context - #5

Merged
thomasrepnik merged 1 commit into
masterfrom
test/signal-reactive-dispatcher
Nov 6, 2026
Merged

thomasrepnik merged 1 commit into
masterfrom
test/signal-reactive-dispatcher

Conversation

@thomasrepnik

Copy link
Copy Markdown
Owner

Summary

Refers to #3 (does not close it). No generator changes: this protects behaviour the generated Angular dispatcher already has.

computed(() => dispatcher.name)
  delegate getter                 # uncached, runs per call
    context() -> provider.get()
      signal()                    # tracked by the computed
 example/
   dispatcher.spec.ts
+  dispatcher-signals.spec.ts     # follows signal + caches, recovers after error, context-free
 package.json                     # adds the spec to `npm test`

Evidence

  • Before: npm test: 53 pass. Nothing failed if the delegate was cached.
    After: npm test: 56 pass, npm run typecheck clean, npm run generate leaves no diff.
  • Tests can fail: with delegate temporarily changed to cache its first result in the generated Angular registry (reverted afterwards), all 3 new tests fail.

Merge Danger

Door: two-way

Test-only. Revert the commit to undo it.

Blast Radius: none

src/ and the published package are unchanged. A future change that caches the delegate will now fail these tests.

Issue #3 can be solved with a signal read by the context provider, because the generated delegate getter reads the context on every call without caching. These tests protect that behaviour.
@thomasrepnik
thomasrepnik merged commit b0b33cd into master Nov 6, 2026
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.

1 participant