i didn't know these Svelte tips

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 30

  • @alexanderleschanz9991
    @alexanderleschanz9991 5 місяців тому +5

    The output of the twMerge() function is always the same string, so it's VERY inefficient to run it, every time time the page reloads.

  • @nathnaelgetachew7379
    @nathnaelgetachew7379 2 місяці тому +1

    Just learnt alot from this.👌
    If you'd just increase the font size and zoom a bit

    • @nevillebrem
      @nevillebrem  2 місяці тому +1

      Yo, will do that. Thanks for the advice

  • @Danielo515
    @Danielo515 2 місяці тому +2

    Post to API logout to delete a todo ? What wn interesting naming convention

  • @AmxCsifier
    @AmxCsifier 4 місяці тому +1

    It's better to named form actions with the enhance helper instead of using fetch. Form actions can have any name and you can have any number of actions. Or better yet, use superforms if the app is quite complex. I wrote a large app without using fetch at all.

    • @AmxCsifier
      @AmxCsifier 4 місяці тому

      You don't need to turn every button into a form. You can use only one form with id=myform for example. Then set form=myform and formaction=?/delete for example on the button. Thus you can have one form and any number of form buttons.

    • @nevillebrem
      @nevillebrem  4 місяці тому

      i know about that... not a bad idea but i am used to doing it with fetch. i am also a big fan of superforms. but somehow the action of creating a form for every button didn't really click to me. but thanks!

    • @AmxCsifier
      @AmxCsifier 4 місяці тому

      @@nevillebrem "the action of creating a form for every button" You don't need to do that.

    • @nevillebrem
      @nevillebrem  4 місяці тому

      how would i pass down data with superforms?

    • @AmxCsifier
      @AmxCsifier 4 місяці тому

      @@nevillebrem Same principle. By using formaction. Although, I prefer to use dataType: json because my forms are quite complex. If you'd like, create svelte lab repl and if you get stuck, I can help you.

  • @imagineabout4153
    @imagineabout4153 5 місяців тому +1

    Very nice brother, just as a tip, increase the font size and browser zoom

    • @nevillebrem
      @nevillebrem  5 місяців тому

      i'll do! thanks for the feedback

    • @midewestmond9442
      @midewestmond9442 3 місяці тому

      Very important most of us are watching from phone

  • @RafaelSouza-l6i
    @RafaelSouza-l6i 5 місяців тому +1

    There is a way to enhance images with url coming from API response? or only local images? Nice video btw

    • @nevillebrem
      @nevillebrem  5 місяців тому +1

      thanks for the feedback! i am not sure, sorry...

  • @ocin3752
    @ocin3752 7 місяців тому +1

    Very useful. Can you do a video on shallow routing?

  • @noname_160
    @noname_160 5 місяців тому +1

    About the first one: it wont work if js is disabled in browser

    • @nevillebrem
      @nevillebrem  5 місяців тому

      a pitty but makes sense ig

  • @tensiondriven
    @tensiondriven 4 місяці тому +2

    On your way to 1,000 subs! Have another!

  • @TheOnlyJura
    @TheOnlyJura 7 місяців тому +1

    Very good video. You should have however targeted svelte 5 probably (or provide both).

    • @nevillebrem
      @nevillebrem  7 місяців тому +1

      i also thought about that. i will make a dedicated svelte 5 video soon though

  • @TheSysmat
    @TheSysmat 6 місяців тому +3

    Http delete not post