ananthbh / SurveyList

0 stars 0 forks source link

A lot of unused closure callback #6

Open peepo3663 opened 6 years ago

peepo3663 commented 6 years ago

I saw a lot of callbacks which is not used or maintained at all for eg.

checkAuthToken { }

Callback inside checkAuthToken If you didn't plan to use it mark it as optional so you will not have another side effects here and also Inside this method you didn't call callback every cases for eg.

case .failure:
                print("failed in fetching data")
            }

you just printed it out but not used callback so this could cause deadlock in your project

ananthbh commented 6 years ago

yeah it's true that I did not handle them. regardign the checkAuthToken it's more to do some updating if needed after the authToken is checked. but it's really needed in all the cases and I agree.