Proposal: Making “provide” also support export overrides.
The main idea of this proposal is to allow developers to create resources that can provide as well as override resource export invokation.
For this example, say we create a resource that is called example_bridge
and provides for a resource called other_bridge
.
We’ll say that example_bridge
has the below code:
exports("GetValue", function()
return 1
end)
We’ll also say that other_bridge
has the below code:
exports("GetValue", function()
return 2
end)
Currently, if example_bridge
provides for other_bridge
, it will not override the resource’s exports if it is missing.
print(exports["example_bridge"]:GetValue()) -- Will error, should print 1 in this proposal.
print(exports["other_bridge"]:GetValue()) -- Will NOT error, will print 2.
Checking if the target provide is currently started will avoid any conflicts, as it will simply use that resource’s exports as the priority.
Feel free to discuss this feature proposal below!