bedesqui
bedesqui
TTCTheo's Typesafe Cult
Created by Alefe Bispo - BRT on 6/9/2023 in #questions
Which content creator offers the best material to learn Nextjs?
https://www.youtube.com/@joshtriedcoding has some amazing videos on Next and Theo's T3 stack tutorial can get you from 0 to production ready in a few hours https://youtu.be/YkOSUVzOAA4
8 replies
TTCTheo's Typesafe Cult
Created by pradeep on 6/8/2023 in #questions
how to remove query from Next js 13 app url without reloading?
If you're fine with soft navigations, the useRouter hook should work. If not, you can change the URL by assigning a new value to document.location.search(Probably a good idea to create the value you'll use with new URLSearchParams(window.location.search)).
3 replies
TTCTheo's Typesafe Cult
Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
that's my assumption too...
14 replies
TTCTheo's Typesafe Cult
Created by Jakub on 5/24/2023 in #questions
What are you guys using for landing pages when creating your app?
I'd generally say staying away from templates is a good idea BUT the folks that do framer templates are killing it recently; There's also https://super.so/ which looks cool. But yeah, generally a next or astro app with some basic styling does the trick and you own it...
8 replies
TTCTheo's Typesafe Cult
Created by hugolepot on 5/27/2023 in #questions
Execute an external TS file in a T3 Stack app
I think ts-node expects cjs
10 replies
TTCTheo's Typesafe Cult
Created by hugolepot on 5/27/2023 in #questions
Execute an external TS file in a T3 Stack app
If you have "type": "module" set for the project, maybe running npx ts-node --esm src/scripts/updateFiles.ts will work
10 replies
TTCTheo's Typesafe Cult
Created by hugolepot on 5/27/2023 in #questions
Execute an external TS file in a T3 Stack app
wym executing a file? Executing as in locally in a terminal?
10 replies
TTCTheo's Typesafe Cult
Created by bedesqui on 2/28/2023 in #questions
get rid of Symbol iterator in autocomplete
Fineeeeeeee, the symbol iterator is supposed to be there, removing it would be lying to the user
3 replies
TTCTheo's Typesafe Cult
Created by bedesqui on 2/28/2023 in #questions
get rid of Symbol iterator in autocomplete
A proposed solution was:
class TryResult<T extends any | null> {
private [Symbol.iterator] = function* (): IterableIterator<[T | null, Error | null]> {
yield [this.data, this.error];
}
public data: T | null;
public error: Error | null;

constructor(data: T, error: Error | null) {
this.data = data;
this.error = error;
}
}

export const trytm = async <T>(
promise: Promise<T>,
): Promise<TryResult<T | null>> => {

try {
const data = await promise;
return new TryResult(data, null);
} catch (throwable) {
if (throwable instanceof Error) {
return new TryResult(null, throwable);
}
throw throwable;
}
};

const mockPromise = new Promise<string>((resolve) => {
setTimeout(() => {
resolve('hello');
}, 1000);
})

async function main() {
const [[data, error]] = await trytm(mockPromise);
const result = await trytm(mockPromise);
}
class TryResult<T extends any | null> {
private [Symbol.iterator] = function* (): IterableIterator<[T | null, Error | null]> {
yield [this.data, this.error];
}
public data: T | null;
public error: Error | null;

constructor(data: T, error: Error | null) {
this.data = data;
this.error = error;
}
}

export const trytm = async <T>(
promise: Promise<T>,
): Promise<TryResult<T | null>> => {

try {
const data = await promise;
return new TryResult(data, null);
} catch (throwable) {
if (throwable instanceof Error) {
return new TryResult(null, throwable);
}
throw throwable;
}
};

const mockPromise = new Promise<string>((resolve) => {
setTimeout(() => {
resolve('hello');
}, 1000);
})

async function main() {
const [[data, error]] = await trytm(mockPromise);
const result = await trytm(mockPromise);
}
But this makes the destructures look like like [[data, error]]
3 replies
TTCTheo's Typesafe Cult
Created by Cynicade on 1/18/2023 in #questions
How to stop working after work?
it's a transactional relationship, they give you a set amount of money, you give them an equivalent amount of work. Don't fuck with the balance here
13 replies
TTCTheo's Typesafe Cult
Created by Cynicade on 1/18/2023 in #questions
How to stop working after work?
if not, they will be fine for a few hours while you rest
13 replies
TTCTheo's Typesafe Cult
Created by Cynicade on 1/18/2023 in #questions
How to stop working after work?
If you quit, would the company collapse?
13 replies
TTCTheo's Typesafe Cult
Created by Tom on 1/11/2023 in #questions
Best library for pinch to zoom + drag to pan
Ohhhh thats very helpful, did you manage to make the pinch zoom in the direction the user is inching instaead of the center?
19 replies
TTCTheo's Typesafe Cult
Created by Tom on 1/11/2023 in #questions
Best library for pinch to zoom + drag to pan
Let me know if react-zoom-pan-pinch is better because I might adopt it myself lol
19 replies
TTCTheo's Typesafe Cult
Created by Tom on 1/11/2023 in #questions
Best library for pinch to zoom + drag to pan
19 replies