I am trying to write a mock log in while developing my app so I don’t have to actually ping my servers. I wanted to delay the log in to make it look like it was waiting for a response from the server. For some reason, the M:logInUser function is returning immediately and doesn’t return the true/false like I was expecting.
Is there an error with the performWithDelay that is keeping it from delaying? Also, does the callback function not return the boolean? Any help would be greatly appreciated.
local function mockLogIn( email, pass ) for \_, user in ipairs(mockUsers.data) do if (email == user.email and pass == user.password) then return true end end return false end function M:logInUser( email, pass ) return timer.performWithDelay( 2000, mockLogIn(email, pass)) end