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

Revert client instantiate inside of init method. Create with empty … #68

Merged
merged 1 commit into from
May 17, 2024

Conversation

leoromanovsky
Copy link
Member

@leoromanovsky leoromanovsky commented May 17, 2024

…in-memory store. Populate the configuration store in init.


labels: mergeable

Fixes: #issue

Motivation and Context

Client instantiation was pushed from a static method to the init function (b76e8d8)

This means that accessing the instance using EppoClient.getInstance before calling init provided an undefined variable. Making any API calls against it led to crashes.

Description

  • Restores client instantiation in the static method so that it is immediately available. We need to select some kind of configuration store - previously this defaulted to localStorage. Now I am changing this to load from an empty memory store. This changes the client behavior so that between getting the client and calling init it will always evaluate to null.
  • The init method sets the desired configuration store or the factory method detects which environment it is in.

How has this been tested?

…in-memory store. Populate the configuration store in `init`.
@leoromanovsky leoromanovsky marked this pull request as ready for review May 17, 2024 05:30
@leoromanovsky leoromanovsky merged commit fd3c3a7 into main May 17, 2024
2 checks passed
@leoromanovsky leoromanovsky deleted the lr/instance-fixup branch May 17, 2024 06:27
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.

2 participants