Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(es_extended): Extra callback functions #1505

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

Mycroft-Studios
Copy link
Member

Introduces 4 new functions:
ESX.DoesClientCallbackExist
ESX.GetClientCallbackInfo

ESX.DoesServerCallbackExist
ESX.GetServerCallbackInfo

@Mycroft-Studios Mycroft-Studios changed the base branch from main to dev November 25, 2024 19:15
@Kenshiin13
Copy link
Contributor

I don't see the point of this. ESX already throws an error if a resource attempts to access an invalid callback. This just promotes people calling ESX.DoesServerCallbackExist and ESX.DoesClientCallbackExist before every damn callback.

Third party resources can check if their dependencies are started and just assume that all expected callbacks are registered. We are already letting them know if they are not ^^

@Arctos2win
Copy link
Contributor

I don't see the point of this. ESX already throws an error if a resource attempts to access an invalid callback. This just promotes people calling ESX.DoesServerCallbackExist and ESX.DoesClientCallbackExist before every damn callback.

Third party resources can check if their dependencies are started and just assume that all expected callbacks are registered. We are already letting them know if they are not ^^

I agree with Kenshin on this one, there is 0 usecase for it and litterly no one ever requested a functionality like this
in the so many years this project exists.

---@return table | nil
function ESX.GetClientCallbackInfo(eventName)
return Callbacks.storage[eventName]
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be a thing

---@return table | nil
function ESX.GetServerCallbackInfo(eventName)
return Callbacks.storage[eventName]
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be a thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In-Development
Development

Successfully merging this pull request may close these issues.

3 participants