Experiments >

Claim AutoFill: Filing multiple claims at once

Experiment #21618th July, 2021by Joshua Nussbaum

In the last experiment, I added the ability to submit a single claim.

This experiment expands it to submit multiple at once.

Code

It was prettry straight forward, just looping thru all pending shipments and submitting it.

Since I need to the list of pending shipments in a few places, and it’s computed based of shipments, I used a reactive statement keep the logic in one place:

$: pendingShipments = shipments
    .filter(shipment => shipment.status == 'pending')

Then my looping logic was very straightforward:

async function submitAll() {
  for (const shipment of pendingShipments) {
    await submit(shipment, {submit: true})
  }
}

Came together pretty nicely. Pretty good result for just 6 experiments.

Demo

Notes

view all experiments

Stay tuned in

Learn how to add more experimentation to your workflow