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: allow no-callback getData and model.pull #870

Merged
merged 7 commits into from
Nov 30, 2023
Merged

Conversation

rgwozdz
Copy link
Member

@rgwozdz rgwozdz commented Nov 28, 2023

Up until now, provider development required a getData method that took a callback function as its second (last) argument. This forced developers to manage responses and errors through the callback function. This PR allows getData to be a simple async function with a single req argument that returns GeoJSON. Errors can be directly thrown.

Similarly, output-plugins have had to use the callback argument when invoking the model.pull method. It can now be used as a promise, without the callback argument.

Note that Koop is still fully compatible with providers and outputs that leverage the callback pattern.

@rgwozdz rgwozdz added enhancement minor Increment the minor version when merged release Create a release when this pr is merged labels Nov 28, 2023
@rgwozdz rgwozdz self-assigned this Nov 28, 2023
Copy link

changeset-bot bot commented Nov 28, 2023

🦋 Changeset detected

Latest commit: 91f8123

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@koopjs/koop-core Minor
@koopjs/output-geoservices Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rgwozdz rgwozdz merged commit d701d19 into master Nov 30, 2023
7 checks passed
@rgwozdz rgwozdz deleted the f/allow-no-callbacks branch November 30, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement minor Increment the minor version when merged release Create a release when this pr is merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant