Automatically retries until all three checks are solved
It starts out with:
const initialState = {
checks: {
one: undefined,
two: undefined,
three: undefined
}
}
…and the idea is to get to:
const initialState = {
checks: {
one: Symbol.for('solved'),
two: Symbol.for('solved'),
three: Symbol.for('solved')
}
}
In order to do that, three actions are dispatched when starting up the app, setting each of the marks in status Symbol.for('pending')
If a fetch call fails, the check will be set to Symbol.for('failed')
via the FAILED
action. Since the state is updated, the fetch effect will be called again. The fetch effect will find the updated check (from pending
to failed
) and trigger fetch again