PromiseRemoteFunctionMixin
Intended for classes that extend BaseObject only
Functions
Add
PromiseRemoteFunctionMixin:
Add
(
class:
{
_maid:
Maid
}
,
remoteFunctionName:
string
) →
(
)
Adds the remote function mixin to a class
local BaseObject = require("BaseObject")
local Bird = setmetatable({}, BaseObject)
Bird.ClassName = "Bird"
Bird.__index = Bird
require("PromiseRemoteFunctionMixin"):Add(Bird, "BirdRemoteFunction")
function Bird.new(inst)
local self = setmetatable(BaseObject.new(inst), Bird)
self:PromiseRemoteFunction():Then(function(remoteFunction)
task.spawn(function()
remoteFunction:InvokeServer() -- or whatever
end)
end)
return self
end
PromiseRemoteFunction
Returns a promise that returns a remote function