Skip to content

Instantly share code, notes, and snippets.

@chaosmonster
Created November 8, 2023 10:18
Show Gist options
  • Save chaosmonster/4bbba33f0daa99f3c1ed25fa3e581bca to your computer and use it in GitHub Desktop.
Save chaosmonster/4bbba33f0daa99f3c1ed25fa3e581bca to your computer and use it in GitHub Desktop.
signals and http requests in Angular????
export class SignalHttpService {
constructor(private httpClient: HttpClient) {}
getSomeData() {
const result = signal(null);
this.httpClient.get(url).subscribe(data => result.set(data));
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment