ayo, (edited )
@ayo@ayco.io avatar

This is just a fun demo playing around, but very simple to implement with the browser's built-in reactivity. The curly brackets in the code snippet below is a McFly thing to initialize the value server-side.

You can try this now with npm create mcfly@latest

<my-hello-world id="my-hello" data-name="{{name}}"></my-hello-world>  
<input  
 onkeyup="document.getElementById('my-hello').setAttribute('data-name', this.value)"  
 placeholder="Type your name here"  
/>  
ayo, (edited )
@ayo@ayco.io avatar

It looks as if the custom element uses some kind of component store but it's just a variable contained within the component.

ayo,
@ayo@ayco.io avatar

See it in action on the website--just find the demo page, then inspect the code

https://mc-fly.vercel.app/

ayo,
@ayo@ayco.io avatar

If you wanna see more magic, change the data-name value on your dev tools 😂

eduplessis,

@ayo Need to look at this. 😀

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • thenastyranch
  • magazineikmin
  • khanakhh
  • rosin
  • Durango
  • ethstaker
  • Youngstown
  • slotface
  • osvaldo12
  • kavyap
  • tester
  • ngwrru68w68
  • megavids
  • GTA5RPClips
  • InstantRegret
  • tacticalgear
  • cubers
  • everett
  • Leos
  • normalnudes
  • anitta
  • modclub
  • cisconetworking
  • provamag3
  • JUstTest
  • lostlight
  • All magazines