Feedback on my custom loader script?

Hello my fellow advanced scripters :slight_smile:

Can you give me feedback on my latest written code. It’s a loader module for 1 Server, Client script setup. i made today to start up my own personal framework.

I’ll be happy to hear your thoughts, suggestions about it.
Also i tried my best in term of documenting, and writing clean consistent code.
And do you think my implementation is good in term of performance and usability?

Thank you for anyone who will help me out improve :smiley:


–[[@DOC

Creator: Codes Otaku
Created in: 03/06/2020 (D/M/Y)
Last updated by: Codes Otaku
Updated in: 04/06/2020 (D/M/Y)

Description:
	- This module serves as a global
	loader for all the descendants modules.
	
	- Please use it in place of the global lua require function as it provides
	more control and flexibility.
	
	- Requiring this module will return it's Initialization function, so make sure to run it,
	by the parameters that you want.
	Example:
		local loader = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Loader"))()
		
		or given the ReplicatedStorage
		local loader = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Loader"))()
		
		or given the Modules
		local loader = require(Modules:WaitForChild("Loader"))()
API:
	CONSTRUCTOR: Initialize(Boolean NoAutoLoad)
		returns the module table. And loads the elements inside 'Table AutoLoad'
		if 'PARAMETER NoAutoLoad' is NIL or FALSE.
	PUBLIC STATIC: Load(String ModulePath) -> Table module
		returns the specified module.
		If there is a special method inside the module, it will be called:
		- Initialize: Called when the module get loaded for the first time.
	PUBLIC STATIC: MultiLoad(Tuple ModulesPaths) -> Dictionnary{String Path = Table module)
		returns the specified modules in a dictionnary.
		It uses the 'Loader.Load' function internally.
	PUBLIC STATIC: LoadAll() -> Dictionnary{String Path = Table module)
		returns all the modules, after loading them all.
		It uses the 'Loader.Load' function internally.
	GETTER: GetLoaded() -> Dictionnary{String Path = Table module)
		returns all the loaded modules.

–]]
Loader.lua (4.1 KB)

1 Like

This thread should be moved to code review

2 Likes

Oh Thanks. I’ll do that! :slight_smile:

1 Like