onDataError was calling onDataReceived with {data : []} which breaks at the first line since object has no map function. The correct form is probably just []