Improve plugin API robustness

This commit is contained in:
Lucien Greathouse
2018-06-01 23:11:50 -07:00
parent a86347ea32
commit c894b38f06
3 changed files with 31 additions and 22 deletions

View File

@@ -35,6 +35,9 @@ function Api.connect(http)
setmetatable(context, Api)
return context:_start()
:andThen(function()
return context
end)
end
function Api:_start()
@@ -60,8 +63,6 @@ function Api:_start()
self.serverId = response.serverId
self.currentTime = response.currentTime
return self
end)
end