4 ms·
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
by j-krieger 6y ago
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.
- kabes 6y agoI 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.
- WouterSpaak 6y agoAngular 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.