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

Added typings to get_store_value #5194

Closed
wants to merge 2 commits into from
Closed

Conversation

sphinxc0re
Copy link
Contributor

I'm using the get method frequently to get authentication data from a svelte-store outside of svelte-components. To make that work within TypeScript files, I added typings.

@sphinxc0re
Copy link
Contributor Author

I don't understand why the test is failing. Any clues?

@caroso1222
Copy link
Contributor

caroso1222 commented Jul 24, 2020

Your PR is failing because there's a circular dependency. utils.ts requires store/index.ts. store/index.ts requires svelte/internal. svelte/internal contains utils.ts.

In other words:
utils.ts -> store/index.ts -> svelte/internal -> utils.ts -> store.index.ts -> ...

One way to go around this could be reordering the declarations within /store:

  1. Move all the types and interfaces to a file store/types.ts
  2. Move all the functions to store/functions.ts
  3. Edit store/index.ts to preserve the same public API.

But... that'll make it a much bigger PR. You might want to open an issue for that to discuss, I think.

@benmccann
Copy link
Member

Thanks for this! I'm going to close in favor of #5269 which gets the tests to pass

@benmccann benmccann closed this Aug 14, 2020
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.

3 participants