elefcodes
elefcodes
TTCTheo's Typesafe Cult
Created by elefcodes on 9/6/2023 in #questions
Add trpc to app. How bundlesize is affected
What should be the increase in the bundlesize if a add trpc in my app ?
5 replies
TTCTheo's Typesafe Cult
Created by elefcodes on 2/16/2023 in #questions
Inline object do not throw type error
const merge = <S extends Record<string | number | symbol, unknown>>(source: S, target: S) => {...}
const merge = <S extends Record<string | number | symbol, unknown>>(source: S, target: S) => {...}
With the above function I would expect that typescript will complain when types do not match between the 2 arguments
const oneTwo = { one: '1', two: '1' };
const three = { three: '2' };

/*
Typescript throws the EXPECTED error:
Argument of type '{ three: string; }' is not assignable to parameter of type '{ one: string; two: string; }'.
*/
merge(oneTwo, three);

/*
Here Typescript does not throw the expected eror
*/
merge({ one: '1', two: '1' }, { three: '2' });
const oneTwo = { one: '1', two: '1' };
const three = { three: '2' };

/*
Typescript throws the EXPECTED error:
Argument of type '{ three: string; }' is not assignable to parameter of type '{ one: string; two: string; }'.
*/
merge(oneTwo, three);

/*
Here Typescript does not throw the expected eror
*/
merge({ one: '1', two: '1' }, { three: '2' });
I could not wrap my head around why this is happening
3 replies
TTCTheo's Typesafe Cult
Created by elefcodes on 12/9/2022 in #questions
Import on interaction RadixUI Dialog
I started today playing with the radix ui primitives. Is there a way to lazy load on interaction the content of the dialog if the dialog is uncontrolled ? Basically I want to load the code that displays a modal only if a user clicks the trigger (e.g. button)
1 replies
TTCTheo's Typesafe Cult
Created by elefcodes on 11/19/2022 in #questions
Next 13 AppDir + middleware
7 replies
TTCTheo's Typesafe Cult
Created by elefcodes on 11/5/2022 in #questions
Sign out (redirect true) in Docker
So I have this problem where I want to use
signOut({redirect:true})
signOut({redirect:true})
and let's say that NEXT_AUTH_URL=localhost:3000 and my docker container runs in localhost:80 so my app is accessible by port 80 and internally the app runs in port 3000, the moment I click to sign out I will be redirected to NEXT_AUTH_URL. For the time being I am using redirect: false and I check if session === null and I redirect users to login page. Is it possible by using redirect: true to by redirected to your actual domain or ip instead the one that Next Auth runs inside the container ?
3 replies
TTCTheo's Typesafe Cult
Created by elefcodes on 10/22/2022 in #questions
am I self taught ?
Can someone who studied at a university be considered self taught ? In my situation I’d say 80% of what I know is because I took the initiative and spend time to learn new skills by myself. While I was doing that of course, I was also pursuing a Computer science degree. But after graduating I cannot say that the degree “boosted” me or it helped me or that it opened doors for me. But for most people that don’t follow an academic career, I believe it’s a similar situation for them.
54 replies