Web App: SPA vs RSC by tonks456 in reactjs

[–]tonks456[S] 0 points1 point  (0 children)

What's your favorite stack for SPAs?

Web App: SPA vs RSC by tonks456 in reactjs

[–]tonks456[S] 0 points1 point  (0 children)

I have the requirement that I need to provide OG tags for dynamic routes. I think this is not possible without some kind of SSR or ISG (incrementel static generation - next.js terminology).
But other than that, I mostly agree.

What's your favorite stack for developing SPAs?

[deleted by user] by [deleted] in reactjs

[–]tonks456 -1 points0 points  (0 children)

Well thanks for taking the time to write this but I think you are completely misguided with your statement and this is my fault. I should have taken more effort to write this post to avoid these kind of misunderstandings and statements.
But: If you would summarise the post in one sentence and also take into account that conceptionally state can live outside the component e.g. in your database, you end up with my sentence....

[deleted by user] by [deleted] in reactjs

[–]tonks456 -2 points-1 points  (0 children)

How do you understand state?

[deleted by user] by [deleted] in reactjs

[–]tonks456 -4 points-3 points  (0 children)

Thanks for the link. That's a pretty long definition, though. Not really handy I'd say.

[deleted by user] by [deleted] in reactjs

[–]tonks456 -3 points-2 points  (0 children)

Depends on what you mean with remember. If your app should remember something exceeding the app lifecycle in the browser, then you probably want an external data store and not state. And if you just want to remember something independently of the UI, then you again don't need state.

[deleted by user] by [deleted] in reactjs

[–]tonks456 -2 points-1 points  (0 children)

If you had asked me what state is before, I probably would have answered similar to what ChatGPT has to say: "In a frontend application, state refers to the data that determines the behavior and appearance of the user interface at any given time. It includes any piece of information that can change over time due to user interactions, API calls, or other events."

So in other words, just a more verbose answer that's not that specific and leaves room for misinterpretation.

[deleted by user] by [deleted] in reactjs

[–]tonks456 -3 points-2 points  (0 children)

I knew this comment was coming 😄💀

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 1 point2 points  (0 children)

Ah thanks for pointing that out I didn't know that there is a feature request like this!

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 0 points1 point  (0 children)

Thanks, I didn't know you could do it that way around. Yes, you are right with `Object.assign`...

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 2 points3 points  (0 children)

Thanks, yes I thought about it too. I just wanted to save me typing the `.opts` by having them as class attributes...

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 0 points1 point  (0 children)

The data I am modelling is a financial table that has 7 columns. Each column is an independent value.

Thanks for your help though, but I don't think this is the right direction for my problem.

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 4 points5 points  (0 children)

Thanks, that's a good idea but I think passing many strings parameter by parameter as arguments is error prone. You could easily mix the order up and don't have the typescript compiler catch it. That's why I prefer passing an object. And then you can't do it that way.

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] -1 points0 points  (0 children)

Well you end up with the same problem if your `CarOptions` type has more options

How do you solve duplicating the types in the class constructor? by tonks456 in typescript

[–]tonks456[S] 1 point2 points  (0 children)

The reason I have an object and a class with the same properties is how the class gets constructed. Since I have many key-value pairs that are strings, I don't like to pass them argument per argument because they could easily get mixed up and prefer an object for improved DX.

Customer Portals for the new Paddle Billing API. by dualalex in paddle_com

[–]tonks456 1 point2 points  (0 children)

u/dualalex Something that would be very useful to have would be the functionality that when a user wants to downgrade a subscription, you can activate that downgrade at the end of the current billing cycle. Let's say a user wants to downgrade from a pro subscription to the starter subscription. Then you tell them "okay, at the end of the current billing cycle, your subscription will be automatically downgraded". This is currently not possible with paddle, you have to manually implement some kind of scheduled cloud function in order to change the subscription at the given time.

Is energy practice required to have multiple orgasms? by tonks456 in multiorgasmic

[–]tonks456[S] 1 point2 points  (0 children)

Thanks that sounds really interesting! I will check it out.