pullPending = (tasks, task) => {
  const { id } = task
  const pending = tasks.find($ => $.id === id)

  if (pending == null) {
    throw Error('Unable to find a pending task')
  }

  return {
    pending,
    rest: tasks.filter($ => $.id !== id)
  }
}
Takes array of pending job states and job that was updated and returns
array of pending jobs but the one passed & start time of that job
@template T, I
@param {PendingJob<T, I>[]} tasks
@param {JobState} task
@returns {{pending:PendingJob<T, I>, rest:PendingJob<T, I>[]}}