Open History to see the last commit
1<div>
2 <h1>Auto Refetch with refetchInterval set to {{ intervalMs() }}ms</h1>
3 <p>
4 This example is best experienced on your own machine, where you can open
5 multiple tabs to the same localhost server and see your changes propagate
6 between the two.
7 </p>
8 <label>
9 Query Interval speed (ms):
10 <input [value]="intervalMs()" (input)="inputChange($event)" />
11 <span
12 [ngStyle]="{
13 display: 'inline-block',
14 marginLeft: '.5rem',
15 width: '10px',
16 height: '10px',
17 background: tasks.isFetching() ? 'green' : 'transparent',
18 transition: !tasks.isFetching() ? 'all .3s ease' : 'none',
19 borderRadius: '100%',
20 transform: 'scale(2)',
21 }"
22 ></span>
23 </label>
24 <h2>Todo List</h2>
25β
26 <input placeholder="Enter something" (keydown.enter)="addItem($event)" />
27 <ul>
28 @for (item of tasks.data(); track item) {
29 <li>{{ item }}</li>
30 }
31 </ul>
32 <div>
33 <button (click)="clearTasks()">Clear All</button>
34 </div>
35</div>