Skip to content

Conversation

@maleetz
Copy link

@maleetz maleetz commented Dec 2, 2025

Simplifies the common use case of static keys / params for the signal APIs by avoiding the toObservable call, which uses the angular effect API to listen to changes from the signal and propogate those into the observable stream. Using the effect call causes the component to render twice, once with an empty string as the signal value and the second time asyncronously with the actual value.

Closes: #894

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #894

What is the new behavior?

This change simply removes the toObservable call for static use cases and replaces it with a basic of call, thereby removing the async nature of toObservable.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Simplifies the common use case of static keys / params for the signal
APIs by avoiding the toObservable call, which uses the angular effect
API to listen to changes from the signal and propogate those into the
observable stream. Using the effect call causes the component to render
twice, once with an empty string as the signal value and the second time
asyncronously with the actual value.

✅ Closes: jsverse#894
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 2, 2025

Open in StackBlitz

@jsverse/transloco

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco@895

@jsverse/transloco-locale

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-locale@895

@jsverse/transloco-messageformat

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-messageformat@895

@jsverse/transloco-optimize

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-optimize@895

@jsverse/transloco-persist-lang

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-lang@895

@jsverse/transloco-persist-translations

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-persist-translations@895

@jsverse/transloco-preload-langs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-preload-langs@895

@jsverse/transloco-schematics

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-schematics@895

@jsverse/transloco-scoped-libs

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-scoped-libs@895

@jsverse/transloco-utils

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-utils@895

@jsverse/transloco-validator

npm i https://pkg.pr.new/jsverse/transloco/@jsverse/transloco-validator@895

commit: 15ed0d5

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.

Bug(transloco): translateSignal API adds unnecessary async task when using string for key parameter

1 participant