nexxel
Explore posts from serversTTCTheo's Typesafe Cult
•Created by nexxel on 4/23/2023 in #questions
how to override extended eslint config
hi i am using antfu's eslint config (https://github.com/antfu/eslint-config). here's my
.eslintrc.cjs
now i want to override a rule to use double quotes instead of single quotes. the readme says i can override it by adding it to a rules
field. so i added it like this:
but instead of overriding, its actually enforcing both the rules.
https://this-vegetable.is-from.space/Code_53HG4zHeSp.gif24 replies
SIASapphire - Imagine a framework
•Created by nexxel on 3/18/2023 in #sapphire-support
How do I listen for reactions on all messages in a channel?
doing discord bot dev after a long time. i wanted to listen for message reactions on every message in a channel and run a db query in the
run
function. but for some reason i can't even get a simple log to work rn. what am i doing wrong here?
16 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 2/16/2023 in #questions
very huge typescript question
36 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 2/5/2023 in #questions
Need help with typescript stuff
I am trying to implement the
Maybe
monad in typescript. It's like the Option
type in Rust.
Here's what I have so far:
Here the from
method is used to take in a value and convert it to a Maybe<value>
. For example:
But there's a problem, when I pass a value that could either be some type (like number, string, etc) or null or undefined, it returns Maybe<value | undefined>
. The Maybe monad handles this by using none
so there's no need to have Maybe<value | undefined>
, it just needs to be Maybe<value>
. For example:
How do I modify my code in order to implement this behaviour?
Playground link: https://www.typescriptlang.org/play?#code/MYewdgzgLgBAcuApjAvDAygTwLYCMQA2AFAEQJiIkCUA3AFB2IAeADiAE6zAECGEEMALI9MuRAB4AKgD4YAbzowYoSFHYBXYFA5EW7AJYA3HlGTGC6xAC4YkmAB8YUTC0QgAZvCRV5AXwZK0Cb6wDAQINgSMkTmljaSVDbColGyCkpK+p4xPBbIKAUwYOoEBA6OsfmF6mAAJoju+hS1PuyIUOrsYEIiYgB0YEhS0kS0ARltHV1FiADuPSnDOXljSv6KYVDBoYMUS4kLYsPyG0qTnd0U88lH0eSIqzDrgVtQITDu7BFLlfEHN6kThkYFkYMtLKhCsVSuUYJVIWgavVGs1Wu0LodEAMhtExqcYOdpgC+uFIuCHvQ1uMWOpcAR3tgTMAABbiACqIzkYQiiAANEUkE8bFzSdYwb9bD4ULI2TQBRQbKNUDKngc2UCMqCiFBmfoIH14QU0Pc0VNLkhRvR8YTuqLtbr9ZVHs8YDS6QyeCx2SN3GBFRKEsqYGz-r0JByNZlsjq9QbchCjV4KKaMcTduGRnjgTbMSSeURffbY07ndTafTQu5eFBhF6OQW-eL42LA9LMd7Q4sI+lNdGHXG8gikw8CeiiWHsXt61mJmPuoWY47m6WNm6KzAAObtADy7AAogQIBnyTYQ-EHMHIyC+8Xm0OTaOzXDm1bs3OnP3KpSnnR1ipoDATCoLmnwREQADaACM-IAEz8gAzAAun0bAsKMYwAPQYcCAB6AD8QA22 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 1/18/2023 in #questions
return type not getting inferred correctly. what am i doing wrong here?
ts playgroud link: https://slug.vercel.app/s/broken-inference
36 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 1/16/2023 in #questions
a question for all the vue devs
how do you define props?
do you use the special typescript syntax:
or the other way:
10 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 12/22/2022 in #questions
Need help in OOP
is there a better way to do this using OOP? this feels a bit inconsistent to me but im inexperienced in OOP and don't know if there's a better way to do this. would love some help!
73 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 11/21/2022 in #questions
jwt vs cookies in next-auth
we recommend using sessions in t3-app but i don't know why. theo says to use sessions but what are the exact reasons one would pick one over the other while using next-auth?
151 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 11/21/2022 in #questions
need help with a complex db query
im making a hackernews clone rn. on the home page i want to display the "trending posts": posts ordered by upvotes which were posted in the last 24 hours. but if there were no posts in the last 24 hours i wanna show the previous posts as well. and also if the user scrolls down enough i still want to show posts before 24 hours as well. how would a db query for this look like?
46 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 11/17/2022 in #questions
solid start routeData errors
reposting here cause got no help in solid server yet
9 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 11/1/2022 in #questions
how to reduce layout shift in astro
im currently in the process of rewriting my old personal site/blog in astro and i have almost finished it. but idk why the layout shift is so huge, please help
deployed version: https://nexxel-dev-v2-6s310ftwp-nexxeln.vercel.app/
124 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 10/29/2022 in #questions
can this be further simplified
i have run into an issue in an astro template and am gonna make a pr with the fix. but the current solution feels hacky
can this be simplified somehow? should i just make a pr and let the maintainers review it?
111 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 10/28/2022 in #questions
what problem do RSCs actually solve?
title
215 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 10/26/2022 in #questions
Should I use next 13 or t3 stack for my current project (long term project)
if i do use t3, how difficult would it be to update to next 13 when it does become stable. also worried about how to use tRPC. i also def need the nested routing
11 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 10/23/2022 in #questions
best way to create reusable components with tailwind and react
i am exploring different ways to create reusable components using tailwind and react and found this https://github.com/enochndika/kimia-UI/blob/main/src/packages/button/button.tsx. is this the best way to do this?
32 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 10/13/2022 in #questions
zod to check if string is only whitespaces
how do i use zod to check if a string is only whitespaces?
18 replies
TTCTheo's Typesafe Cult
•Created by nexxel on 9/29/2022 in #questions
medium, hashnode alternatives?
are there any alternatives to medium and hashnode? i was thinking of building something like it where you can host the blogging platform on a custom domain and was curious if there any other platforms that let you do this. i know i can build a better platform that medium/hashnode but i'd also like to see the alternatives and if they are better or worse.
1 replies