CreateCallback

Create a callback function

Parameters description

ParameterTypeDescriptionDefault

name

string

callback name

----

isLocal

boolean?

is the callback local (import method only)

false

cb

any|function

callback value

----

Example

-- Export method
HRLib.CreateCallback('test:testCallback', function()
    return 'test'
end)

-- Import method
HRLib.CreateCallback('testCallback', true, function()
    return 'test'
end)

-- or

HRLib.CreateCallback('test:testCallback', false, function()
    return 'test'
end) -- equivalent of the example for the export method

Last updated