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

Refactor the API to use undefined instead of null #453

Merged
merged 5 commits into from
Jun 17, 2024
Merged

Conversation

josdejong
Copy link
Owner

@josdejong josdejong commented Jun 17, 2024

Reason: the API currently has a mix of null and undefined. To unify this, we will use undefined everywhere. This works better than null since undefined is the "default" in JavaScript, for example with optional chainging, missing properties, empty array slots, function argument defaults. Also: null is a valid JSON value, so for the Content.json type we must use undefined when there is no JSON.

This is a breaking change in the following properties and methods:

  • selection
  • onChange (contentErrors and patchResult properties)
  • onRenderContextMenu (selection property)
  • onSelect
  • validate (returns undefined)
  • select

@josdejong josdejong merged commit 3a9d51b into v1 Jun 17, 2024
3 checks passed
@josdejong josdejong deleted the feat/undefined branch June 17, 2024 07:29
@josdejong josdejong mentioned this pull request Jul 30, 2024
Merged
15 tasks
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.

1 participant