Skip to content

Conversation

@Cocodrulo
Copy link
Contributor

Description

This pull request introduces a new helper function to the shared codebase to simplify access to shared data. The main change is the addition of a generic GetShared function, making it easier and safer to retrieve shared data from various shared namespaces.

Helper function addition:

  • Added the GetShared function to shared/main.lua, allowing retrieval of shared data from specified shared namespaces with safe navigation.

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@Z3rio
Copy link
Contributor

Z3rio commented Dec 23, 2025

I dont personally see which way this adds any value. As any script using qbcore would anyways have to import the QBCore object, and would therefore already have access to that value - the same way your proposed export does.

I do like the idea though, but for it to actually be effective, we would ideally need to refactor quite a lot of qbcore to work with exports instead, if the endgoal is to not have ot import the core object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants