Sleitnick / AeroGameFramework

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
https://sleitnick.github.io/AeroGameFramework/
MIT License
215 stars 57 forks source link

Consider returning the given module from :WrapModule() #186

Closed OttoHatt closed 4 years ago

OttoHatt commented 4 years ago

WrapModule is useful for requiring external modules - it would be a lot easier to write the require statement it in one line, similar to how you require modules that are already in the framework. This is not possible as WrapModule returns no value.

-- Current. WrapModule returns nothing. Not obvious that it mutates the table.
local MyModule = require(script.MyModule)
self:WrapModule(MyModule)

-- Convenient. Also obvious that the required table is modified.
local MyModule = self:WrapModule(require(script.MyModule))
-- This will still work - no code is broken!
local MyModule = require(script.MyModule)
self:WrapModule(MyModule)
Sleitnick commented 4 years ago

Seems like a good improvement. Want to make a pull request for it? Should be a simple change to the WrapModule method within both the AeroServer and AeroClient scripts. Just need to return the module.

OttoHatt commented 4 years ago

Implemented this in #190