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!(API): add callback(result) to lua API #246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alfaix
Copy link

@alfaix alfaix commented Jun 27, 2024

In this PR I add callback(result) as the last parameter to most API calls, and:

  1. Make sure it is always called exactly once, be that in case of success or failure
  2. Fix a bug with Result type: its new method was setting attributes on the class instead of the object
  3. Fix a bug with Types type: SUCCESS was 1 when there are places in code that assume that it is 0
  4. Add a couple of error messages

I tested this locally - to an extent, let me know if there is some kind of proper procedure to know it's working.

RESOLVES: #245

@Civitasv
Copy link
Owner

LGTM. This is indeed improve the API quality, thanks for your work! I think you should also document it somewhere. Maybe create a API file in the docs folder.

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.

Suggestion: provide a stable callback-based lua API
2 participants