Hacker News new | past | comments | ask | show | jobs | submit login

It's because react works with immutable state.

Svelte instead opts for compile-time magicks to handle state.

Angular uses decorators to manage state. This has turned out to be an unwise descision because javascript decorators have changed in spec since then.




Angular does not use decorators to manage state. It uses decorators to create compile-time instructions for the dependency injection system to wire components, services, and directives together (I'm simplifying a bit here). Should TypeScript ever drop their decorator implementation, this could all be fairly easily changed to do it with functions instead:

  export class AppComponent { }
  
  export const appComponent = Component(AppComponent, {
    template: '<h1>Hello World!>/h1>
    // other compile-time instructions
  });
How you want to approach runtime state has nothing to do with decorators.


I was talking about angularjs. not angular.

And like I said, react promised immutable state would solve a lot of problems, but it turns out you lose a lot of convenience as a developer while not gaining that much.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: