Readit News logoReadit News
Liquidor commented on Valdi – A cross-platform UI framework that delivers native performance   github.com/Snapchat/Valdi... · Posted by u/yehiaabdelm
maxloh · a month ago
If you are curious how components' state is handled, they employed the React class components method:

  // Import the StatefulComponent
  import { StatefulComponent } from 'valdi_core/src/Component';
  
  // ViewModel + State interfaces for component
  export interface TimerViewModel { loop: number }
  interface TimerState { elapsed: number }
  
  // Component class
  export class Timer extends StatefulComponent<TimerViewModel, TimerState> {
    // Initialize the state
    state = { elapsed: 0 };
    // When creating the component, start a periodic logic
    private interval?: number;
  
    // Initialize the setInterval that will update state once a second incrementing
    // the `elapsed` state value.
    onCreate() {
      this.interval = setInterval(() => {
        // Increment the state to trigger a re-render periodically
        const elapsed = this.state.elapsed;
        const loop = this.viewModel.loop;
        this.setState({ elapsed: (elapsed + 1) % loop });
      }, 1000);
    }
  
    // When component is removed, make sure to cleanup interval logic
    onDestroy() {
      if (this.interval) clearInterval(this.interval);
    }
  
    // Render visuals will depend both on the state and the view model
    onRender() {
      <view padding={30} backgroundColor='lightblue'>
        <label value={`Time Elapsed: ${this.state.elapsed} seconds`} />;
        <label value={`Time Looping every: ${this.viewModel.loop} seconds`} />;
      </view>;
    }
  }
https://github.com/Snapchat/Valdi/blob/main/docs/docs/core-s...

Liquidor · a month ago
I miss the React class components. No need for 30 different and error prone useFunctions
Liquidor commented on DaisyUI: Tailwind CSS Components   daisyui.com/... · Posted by u/a_bored_husky
Liquidor · 5 months ago
I don't really use Tailwind. I enjoy my (S)CSS.

I took a look at https://daisyui.com/components/button/ and immediately I see classes that look similar to Bootstrap.

So my question is: Why build components on top of something like Tailwind instead of just regular CSS? Or are you able to customize and use Tailwind mixed in with the components? Then sure why not I guess.

Otherwise it feels like going full circle here.

Liquidor commented on New EU rules on digital accessibility to come into force   rte.ie/news/technology/20... · Posted by u/austinallegro
Liquidor · 6 months ago
Uhm hasn't this been the case since 2019-2022 or somewhere close to those years?

In Denmark we had a year to make government/public apps fully accessible and the same for websites and documents presented on websites.

We also had to create accessibility certificates and dedicated pages on the websites to prove and clarify the state of the accessibility (or lack of, together with a statement of what's being done to remedy the issues).

Are these "new" EU laws for a different sector (private?) or something else? I can't find any references in the article. I may be blind (pun intended).

Liquidor commented on How to change your settings to make yourself less valuable to Meta   johnoliverwantsyourratero... · Posted by u/SLHamlet
Liquidor · 10 months ago
I've got a couple of thoughts.

1) Why do you guys care what ads are being displayed to you?

2) Do you even allow ads to be displayed in the first place (ad blockers etc.) ?

3) Yes, we get it. Uninstall Facebook/IG/WhatsApp..., but no. Most people in the world use these, and you're still targeted without using them.

4) Why just Meta? What about Google, YouTube, Bing and many other ad providers?

5) Is this a political campaign by Warner Bros., EFF or someone else?

6) Shouldn't this stuff just be regulated instead? I'm sure the EU has some regulations at least. What about the US?

Liquidor commented on X users are unable to post “Signal.me” links   disruptionist.com/p/elon-... · Posted by u/confusing3478
j-bos · 10 months ago
This comment section has turned into something of a circle, it's cool to be mad nd all, but there was a comment expressing doubt at the details, wonder about a reason other than those stated, and asking if anyone independently verified, as I clicked it the comment was flagged to oblivion. No opportunity to engage with that viewpoint.
Liquidor · 10 months ago
HN is always a mess when the subject contains Musk, Trump, Google, browsers or social media platforms in general.

I don't mind the slight political aspects of things, but reading a ton of hate and "I already deleted X" (pun intended) and "Just use Y other platform" (that no normal user can figure out) comments is just uninteresting and should stay on Reddit or wherever these nonproductive comments fit into.

I'd love to hear more about this case, the technical aspects and the follow-ups/investigations. Let's focus on that, no? Maybe it's just me.

Liquidor commented on WikiTok   wikitok.vercel.app/... · Posted by u/Group_B
Liquidor · 10 months ago
I like it a lot :-) It scrolls a bit too far though. I move my fingers fast and it skips articles because of the momentum. Also when at the top, scrolling up it should maybe refresh? And it would be nice with a visual indicator that new articles are being loaded when at the bottom.

Kudos!

Liquidor commented on WikiTok   wikitok.vercel.app/... · Posted by u/Group_B
anon3459 · 10 months ago
Using nextjs with a serverless function acting as a proxy is pretty simple
Liquidor · 10 months ago
Don't you mean Node.js ? I don't see why you would use a full Next.js framework for just a reverse proxy.
Liquidor commented on PHP 8.4   php.net/releases/8.4/en.p... · Posted by u/theThree
tail_exchange · a year ago
I'm also not a php developer, but I agree. This seems like a huge footgun.

I've never been a fan of this kind of magic, and I wonder how other languages deal with this case.

Liquidor · a year ago
Lua has rawget() and rawset() to bypass the magic methods, which is used a lot inside/outside the metatables (objects with magic methods) to avoid magic loops I guess.
Liquidor commented on Flameshot – Open-source screenshot software   flameshot.org/... · Posted by u/nikolay
dspillett · 2 years ago
I've been using ShareX (https://getsharex.com/) for some years, which is also open-source, and very featureful while not feeling too bloated, though Windows only.

I'll have to have a look at this next time I'm on a Linux desktop, as I found the options lacking compared to ShareX last time I looked.

Liquidor · 2 years ago
I use ShareX for Windows and Flameshot for Linux. I wish ShareX worked for Linux. It's so good.
Liquidor commented on Slack AI Training with Customer Data   slack.com/trust/data-mana... · Posted by u/mlhpdx
troupo · 2 years ago
> But you can opt out, right? So what’s the problem?

This thinking is the problem. "Oh, we just added your entire private/privileged/NDA/corporate information to our training set without your consent. What's the problem?"

Opt-out must be the default.

Edit: By "Opt-out must be the default." I mean: no one's data must be included until they explicitly give consent via an opt-in :)

Liquidor · 2 years ago
> Opt-out must be the default.

Don't you mean opt-in must be the default?

Or am I misunderstanding the concept of opt-ins :P

u/Liquidor

KarmaCake day108September 18, 2017
About
Developer with a passion for JavaScript.
View Original