Skip to content

feat(es_extended/server/modules/onesync.lua): Add Synchronous, Non-Ca…#1653

Merged
Kenshiin13 merged 4 commits into
esx-framework:devfrom
Meyndflay:OneSyncSpawn
Jul 6, 2025
Merged

feat(es_extended/server/modules/onesync.lua): Add Synchronous, Non-Ca…#1653
Kenshiin13 merged 4 commits into
esx-framework:devfrom
Meyndflay:OneSyncSpawn

Conversation

@Meyndflay

@Meyndflay Meyndflay commented Jun 9, 2025

Copy link
Copy Markdown

Description

This PR adds a synchronous, non-callback option to the other OneSync.Spawn functions.

Motivation

The ESX.OneSync.SpawnVehicle function already supports this feature, so I applied it to the other Spawn functions. Having a synchronous version of OneSync.Spawn adds simplicity and prevents callback hell in the user's codes.

Implementation Details

We make use of FiveM's promises library along with Citizen.Await() to add a feature that is similar to JS's async-await.

Usage Example

local netObj = ESX.OneSync.SpawnObject(model, coords, heading)
local netPed = ESX.OneSync.SpawnPed(model, coords, heading)

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@github-project-automation github-project-automation Bot moved this to 🆕 To be Discussed in ESX Roadmap Jun 9, 2025
@Kenshiin13 Kenshiin13 changed the base branch from main to dev June 11, 2025 20:14
Zykem

This comment was marked as duplicate.

@github-project-automation github-project-automation Bot moved this from 🆕 To be Discussed to In-Development in ESX Roadmap Jun 19, 2025
Comment thread [core]/es_extended/server/modules/onesync.lua
Comment thread [core]/es_extended/server/modules/onesync.lua
@Meyndflay Meyndflay requested a review from Zykem June 19, 2025 18:55

@Zykem Zykem left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, Thanks!

@github-project-automation github-project-automation Bot moved this from In-Development to Ready for Next Update in ESX Roadmap Jul 6, 2025
@Kenshiin13

Copy link
Copy Markdown
Contributor

@Kenshiin13 Kenshiin13 merged commit 90826b1 into esx-framework:dev Jul 6, 2025
1 check passed
@Meyndflay Meyndflay deleted the OneSyncSpawn branch July 7, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Next Update

Development

Successfully merging this pull request may close these issues.

4 participants