resource() vs rxResource() vs httpResource()

All three APIs give you the same signal surface: value(), isLoading(), error() and reload(). They differ only in how you tell them to fetch.

1. resource() with reactive params

Custom async loader with abortSignal. params returns undefined until you click, so it loads on demand only.

2. httpResource() with a URL function

The URL function reads isMultiCityMode(), so flipping the toggle re-fetches automatically through HttpClient.

weather icon

Temperature: 21

Condition: Partly cloudy

3. rxResource() with the stream option

Bridges an RxJS service (WeatherService.getWeather()) into signals. In v22 the option is named stream.

weather icon

Temperature: 21

Condition: Partly cloudy