Solid Donor Roster — SolidJS

Keep a blood drive’s roster right while answers run late: resources, stores, context, boundaries. 13 levels, right in the browser.

What the levels ask

  1. Saturday, 07.40, on the Community Hall’s yard. The PMI Regency bus has parked, and Ms. Yuli, the district’s PMI volunteer, switches on the donor roster page on the desk’s computer. The board asks the PMI server in town for the donors of each blood group over a weak signal: the answer for group A is slow, the one for O is quick. Mrs. Sari taps O soon after the board comes on. Read the code, then guess: once every answer has arrived, what does the board show?
  2. 07.45, the same morning played again: the A answer is slow, the O answer quick, and Mrs. Sari taps O. This time fill the line that fetches the list. Once every answer is in, the board must still list group O under the heading Golongan O, and Mrs. Sari’s tap must call PMI for O.
  3. 07.52. Mr. Harun arrives, and Ms. Yuli looks up his name in the search box. The phone the desk’s computer runs on has little data left, so PMI may only be asked once there are three letters. Fill in the resource’s source: typing H, Ha, then Har must call PMI exactly once, and the result must be Mr. Harun (O).
  4. 08.05. The queue board in the tent loads from PMI, and every time someone new registers, somebody taps Segarkan (refresh). Fill in its two parts: the memperbarui... (refreshing) sign must show while PMI has not answered, on the first load and on a refresh. During a refresh the old queue must stay on the board until the new one arrives with Mrs. Sari in it.
  5. 08.20. People registering at the desk want to see their name at once, though PMI needs a second and a half to record it. Mr. Harun registers and PMI records him. Then Mrs. Sari registers, and the signal to PMI drops. Fill in the two parts: a name must show when the button is tapped, and a name that failed to register must disappear again when the failure comes in, without asking PMI for the list again.
  6. 08.40, at the check desk. The queue is kept in a store and refreshed from PMI every twenty seconds. Ms. Yuli writes Mr. Tono’s check in the note box on his row. Then the queue refreshes: Mr. Tono is being checked, and Mrs. Sari has just joined. Fill in how the new data is put in: only Mrs. Sari’s row may be built, and Mr. Tono’s note must stay.
  7. 09.05. When a donor’s bag is full, Ms. Yuli taps Selesai (done) on their row. Two things must change at once: the donor’s status becomes selesai, and the bags still needed for their group drop by one. Mr. Tono (A), then Mr. Harun (O), finish. Fill in the body of selesai.
  8. 09.10. Every bag count from PMI goes to the PMI bus driver by SMS, sent by an effect. A count carries three numbers at once. Fill in the two parts: one count must make exactly one SMS, with no half-updated numbers. When Mr. Jaya takes over the desk from Ms. Yuli, no SMS may go out, but the next SMS must name Mr. Jaya.
  9. 09.30. The queue page has two screens: the registration desk, where people are signed up, and the board in the tent, where people are called to a bed. Both must always show the same number. Mr. Dodi registers, the board calls Mr. Tono, then Ms. Wulan registers. Fill in useAntrean and what App wraps.
  10. 09.45. The stock board shows the bags available for each blood group, each from PMI Regency, plus the queue. The stock for A, B and O arrives, but PMI never answers about AB. Choose where the ErrorBoundary goes: group AB must say Golongan AB: PMI belum menjawab (PMI has not answered), and the other stocks and the queue must still read.
  11. 09.55. The same stock board, now with waiting messages. The stock for A, B and O arrives within a second, but AB hangs for three seconds and then fails. Choose where Suspense and the ErrorBoundary go: after one second A, B, O and the queue must already show, and after AB fails only AB says Golongan AB: PMI belum menjawab.
  12. 10.05. PMI has put up a new server: every donor now has a kode, not an id, and the queue is sorted by number. Ms. Yuli again writes Mr. Tono’s check in his note. Then the queue refreshes, and Mrs. Yanti, who registered online last night, comes in first. Fill in how the new data is put in and the list component: only Mrs. Yanti’s row may be built, and the note must stay beside Mr. Tono.

And more, 13 levels in all.