solidjs-community / solidjs-community/solid-primitives

Typing improvement on setting/getting storage

Open
#316 1 comment 0 reactions 1 assignee View on GitHub

@atk is already working on this.

Since Aug 29, 2023.

enhancement
Dominant language
TypeScript
Stars
1.6k
Forks
162
Avg merge
19h 40m
Merged PRs (30d)
8

Description

So, I was using createStorage with an object interface like this:

const [appStore, setAppStore] = createStorage<{
  endpoint: string;
  query: string;
  ...
}>()

As I used the setAppStore(), and set the first parameter, I expected the keys of object to show up as options like this:

image

but it seems like the typescript didn't recognize the keys.

Is it possible this feature could be added? also I just did a little experiment on this so if it's ok, I'd be happy to help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.