
🇨🇭Account based in
About this account
- Account based in
- Switzerland
- Connected via
- Switzerland Android App
Account-level information from X, not a live location or the device used for a specific post.
![@Component({
template: `
<button (click)="clicks$.next($event)">Load Data</button>
@if (data.hasValue()) {
<app-display-data [data]="data.value()" />
}
`
})
export class SkolComponent {
readonly #dataService = inject(DataService);
click$ = new Subject<MouseEvent>();
latestClick = toSignal(this.click$, {initialValue: null});
data = rxResource({
request: () => ({clicked: this.latestClick()}),
loader: ({request}) => {
if (!request.clicked) {
// I have to do this to prevent an HTTP
// call until the user clicks on the button
return of(null);
}
return this.#dataService.getData();
},
});
}](https://pbs.twimg.com/media/Gc-UYsrWYAASjbU.jpg?name=small&format=webp)
ALT @Component({ template: ` <button (click)="clicks$.next($event)">Load Data</button> @if (data.hasValue()) { <app-display-data [data]="data.value()" /> } ` }) export class SkolComponent { readonly #dataService = inject(DataService); click$ = new Subject<MouseEvent>(); latestClick = toSignal(this.click$, {initialValue: null}); data = rxResource({ request: () => ({clicked: this.latestClick()}), loader: ({request}) => { if (!request.clicked) { // I have to do this to prevent an HTTP // call until the user clicks on the button return of(null); } return this.#dataService.getData(); }, }); }




















