suchcodemuchwow
suchcodemuchwow
Explore posts from servers
KKysely
Created by suchcodemuchwow on 7/28/2023 in #help
Wrong return type in raw sql
Wooow thanks a lot for the suggestions Igal, it helped a lot ❤️
7 replies
KKysely
Created by suchcodemuchwow on 7/28/2023 in #help
Wrong return type in raw sql
Hello 🤗 Planetscale dialect
7 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
🫡 🤗 Thanks a lot
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
I haven't found any info about this in docs or even in examples
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
I can open a pr for docs
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
Now it's clear
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
Ohhh thanks a lot
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
Ohhh I see
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
You mean useStorage( first, second) right ? I couldn't find any other example or docs about it do you know any that you can redirect me ?
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
I'm new to the discord not sure if you have seen my reply @louisgv sorry if I'm disturbing 😅
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
Ohh thanks a lot ❤️ I was going to update here because I figured that out just now ❤️ If you don't mind me asking, I am experiencing something pretty weird:
const [userId] = useStorage<string>("user-id", (storedId) =>
typeof storedId === "undefined" ? nanoid() : storedId
)

console.log("App mounted", { userId })

useEffect(() => {
console.log(userId)
}, [])
const [userId] = useStorage<string>("user-id", (storedId) =>
typeof storedId === "undefined" ? nanoid() : storedId
)

console.log("App mounted", { userId })

useEffect(() => {
console.log(userId)
}, [])
Which logs this out:
App mounted {userId: 'Z3ltFdYKVwk6BGzDt5JTC'} app.tsx:36
Z3ltFdYKVwk6BGzDt5JTC app.tsx:32
App mounted {userId: 'n-EiDTOsDuClJTLKBwAO-'} app.tsx:36
App mounted {userId: 'Z3ltFdYKVwk6BGzDt5JTC'} app.tsx:36
Z3ltFdYKVwk6BGzDt5JTC app.tsx:32
App mounted {userId: 'n-EiDTOsDuClJTLKBwAO-'} app.tsx:36
I guess there is some type of race condition happening here because first logged value "Z3ltFdYKVwk6BGzDt5JTC" is changing every time I refresh the page but second value is coming from actual store. Do you have some suggestion to prevent this behaviour ? My usecase is: I want to generate random id when user opens the extension then use that lifespan of the extension basically.
23 replies
PD🧩 Plasmo Developers
Created by suchcodemuchwow on 7/16/2023 in #👾extension
Local Storage Item does not show up in service worker dev tools ?
This is the background script I have:
async function reviveUser() {
const storage = new Storage({
area: "local",
})


let userId = await storage.get("user-id")

if (!userId) {
userId = nanoid()
await storage.set("user-id", userId)

// createUser({ userId })
}

return userId
}
async function reviveUser() {
const storage = new Storage({
area: "local",
})


let userId = await storage.get("user-id")

if (!userId) {
userId = nanoid()
await storage.set("user-id", userId)

// createUser({ userId })
}

return userId
}
23 replies
KKysely
Created by suchcodemuchwow on 7/8/2023 in #help
Does kysely convert Table names lowercase when it's building a query ?
As far as I can see from the docs https://kysely-org.github.io/kysely/interfaces/CamelCasePluginOptions.html there is no configuration option for keeping table name as it's but camelcasing the column names. Is there a way I can achieve this ?
4 replies