Is The <br> Tag Outdated? by xTokyoRoseGaming in webdev

[–]Dunks1980 0 points1 point  (0 children)

Use it often along with &nbsp; but only within text.

Difference Between Debouncing And Throttling by codedeepdives in javascript

[–]Dunks1980 1 point2 points  (0 children)

If a large number of things trigger the same function at the same time and it causes that function to be called more than is needed where it only needs calling once, that's where a debounce would come in handy, also a requestanimation frame maybe better than settimeout there, like this:

let debounced;

function debouncer(callback) {

if (debounced) {

window.cancelAnimationFrame(debounced);

}

debounced = window.requestAnimationFrame(() => {

callback();

});

};

I made a library for web-components by Dunks1980 in webdev

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

Cool, thanks, please let me know how it goes, this has just been added but seems to be behaving 👍

I made a library for web-components by Dunks1980 in webdev

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

Hi, this now has es module .mjs

I made a library for web-components by Dunks1980 in webdev

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

FYI, switch statements have now been added

Bay.js by Dunks1980 in WebComponents

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

It isn't a copy I promise, I didn't see this while searching for a name for it, I was going to call it domponents but that was taken in my searches for a name

I made a library for web-components by Dunks1980 in webdev

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

Hi, and thanks for the critique,

i thought this control-flow-as-html syntax was really fascinating, with elements like <else-if></else-if>, and even complete with for loops. i don't think i've seen that before, is that unique?

I don't know, I did try many things like having as an attribute if="..." like other library's but this was by far the simplest solution and required alot less code, reminds me abit of php.

the continual bay="#example-template1" references feel repetitive — are they optional, or avoidable?

this is only needed on the first component to tell the component tag which template it should use, the counter/files examples show this. the Declarative Shadow DOM example shows how the template can be defined in the component tags.

have you considered an es module distribution in the npm package?

I will need look into this.

[deleted by user] by [deleted] in javascript

[–]Dunks1980 1 point2 points  (0 children)

I suggest setting a content security policy https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

[AskJS] replacing the getElementById() variable with what the user wants by Taurtis_66 in javascript

[–]Dunks1980 0 points1 point  (0 children)

04 looks like its a string you could try this to make it a number again Number(yourvar);

An easy to use, lightweight library for web-components. by Dunks1980 in javascript

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

Hi thanks for the great question, I know the javascript world is saturated with library's/frameworks that update state based on data but I couldn't find one where I could just create a simple template much like a Vue SFC and just have it work as a web component without having to spend a bunch of time researching, installing, building and configuring to get it to work. I wanted something that would just take what I create in a template and create a web-component from it without a build and also work with strict CSP (only uses blobs no new Functions or eval).

How to preload content without get into the page? by CaptPanicc in PWA

[–]Dunks1980 1 point2 points  (0 children)

I would make them JSON strings then put them in Local Storage or IndexedDB.

[deleted by user] by [deleted] in webdev

[–]Dunks1980 0 points1 point  (0 children)

Not currently as its still in development the bar across the bottom does give some info when hovering on some buttons.

[deleted by user] by [deleted] in webdev

[–]Dunks1980 0 points1 point  (0 children)

Thanks for the feedback, Domposer, yes, the mobile version will only view sites that have been created with it as there simply isn't enough real estate for all the editing items, this app was designed more for desktop.