DEV Community

artydev
artydev

Posted on

Reactivity in Juris

What a ceremony using reactivity in React : hooks, effects...

Look how simple is it to make a component reactive in Juris Demo

const setupApp =  {
  states : {
    message : "Hello World"
  },
  layout :  {h1 : {text: () => app.getState("message")}}    
}
const app = new Juris(setupApp)

app.render();

app.subscribe("message", (updated, previous) => {
  console.log(`${updated} - ${previous}`)
}) 

setTimeout(() => app.setState("message", "I am about to change..."), 1000);

setTimeout(() => app.setState("message", "Bye World"), 2000);


Enter fullscreen mode Exit fullscreen mode

Could it be simpler ?

Don't let hyped framework to erase your Javascript skills. Rediscover the joy of getting full control on your app, without relying on hours of youtube tutorials

Top comments (0)