CremeDeLaKremlin
CremeDeLaKremlin
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
You guys are awesome. Thanks for answering this, and so fast also.
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Yep, will go with the second proposed approach.
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Ahhh, that does exactly what I want it to do.
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Yes to store, no to reconcile. Though I think my understanding of store is poor
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Gotcha. So what would the solution be? Just destructure user and then access its properties with optional chaining? Would it be bad practice to user destructure again on user?
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Ah yes, I think that error makes sense. Can't we circumvent with:
const x: {user?: {id: string}} = {}
const {user: {id}} = x ?? {}
const x: {user?: {id: string}} = {}
const {user: {id}} = x ?? {}
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
I really appreciate your responses by the way
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
There is one more error in browser: Uncaught TypeError: can't convert undefined to object destructure index.js:39 And this is what I'm passing to destructure: const data: Resource<UserReposQuery | undefined>
24 replies
SSolidJS
Created by CremeDeLaKremlin on 3/17/2024 in #support
How to destructure properly?
Oh sorry, I totally spaced on including the errors I get: Property 'user' does not exist on type 'DeepSpread<ReactiveSource>'
type UserReposQuery = {
__typename?: "Query" | undefined;
user?: {
__typename?: "User" | undefined;
name?: string | null | undefined;
company?: string | null | undefined;
avatarUrl: any;
type UserReposQuery = {
__typename?: "Query" | undefined;
user?: {
__typename?: "User" | undefined;
name?: string | null | undefined;
company?: string | null | undefined;
avatarUrl: any;
24 replies