handleEvents$ :: Observable ()
Main observable for handling incoming events that have been dispatched
to the events$ Subject
. Kind of like a reducer in redux.
It groups the events by type EventType.Fetch or the id
of the Todo.
and uses switchMap
for each group.
dispatch :: TodoEvent -> ()
Function for dispatching to the events$ Subject
An EditEvent, SaveEvent, or DeleteEvent.
dispatchFetch :: () -> void
Dispatches the FetchEvent to the events$ Subject
.
Handle incoming events requesting Todo(s) be deleted from the database.
State is updating first to indicate "in progress". Then the API for deleting Todos is called. Once the call re solves state is updated to indicate failure or success. After a second state is updated once again to reset the operation so that the UI removes the indicators of failure or success.
The delete event DeleteEvent
handleReadEvent :: FetchEvent -> Observable (Transactional TodoWithOperation)
Handles incoming FetchEvent events that have been
dispatched to the events$ Subject
It immediately calls the API for requesting Todos from the server and updates state with the received todos by running the addEffect
The FetchEvent event
handleSaveEvent :: SaveEvent -> Observable ?
Handles incoming SaveEvent events that have been dispatched to [[event$]]
resetOkAndBadTodos :: Observable (RedoableEvent, ResetableOperation) -> Observable (RedoableEvent, ResetableOperation)
Operator for resetting a Todo's TodoOperation to Noop after it was set to Bad or Ok
Generated using TypeDoc