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

Create function to init sdk #93

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

ristomcgehee
Copy link
Contributor

@ristomcgehee ristomcgehee commented Jan 15, 2024

Since in allowing custom strategies there are now more ways to misconfigure the SDK, I figured it would be good to create a dedicated function to initialize the SDK. This also improves the code by not having properties that don't get initialized in the constructor.

Setting "target": "es2017" to support top-level awaits.

Since I had issues when I made other PRs non-backwards compatible, I made this change backwards compatible. If you want to see how the code would look when we remove the public constructor, see 84a65e8. When I update server/ to use init() instead of the constructor, I will also remove the changes in 23f664a.

@ristomcgehee ristomcgehee marked this pull request as ready for review January 15, 2024 02:04
javascript-sdk/src/sdk.ts Show resolved Hide resolved
javascript-sdk/src/sdk.ts Show resolved Hide resolved
Copy link
Member

@cherbel cherbel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

javascript-sdk/src/sdk.ts Show resolved Hide resolved
javascript-sdk/src/sdk.ts Show resolved Hide resolved
@cherbel cherbel merged commit f4e020f into protectai:main Jan 25, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants