I’m designing a API for my plugin where you return a function from a ModuleScript, but I’m wondering how I should pass over the api.
Should I either setfenv the returned function with the API, or pass it as a parameter?
Example
Setfenv:
return function()
api.print("yo")
end
Parameter:
return function(api)
api.print("yo")
end
It’s not exactly a huge difference, but I want to make it as simple as possible to use.
If you have a different idea to these two opposed then I’d like to hear!
I’ll hold a poll:
- Parameter
- Set environment
- Other (please reply!)
0 voters
Thanks!