Skip to content

re: Why Choose NgRx? VIEW POST

re: The NgRx team is doing a great job for sure and they recently reduced the minimal amount of code to write, but to me the use of decorators is a hug...

There's a big difference. Angular's decorators are compiler instructions and are not present at runtime.

Oh, never thought of that.

But once compiled the decorators are just functions no? What is the drawback of decorators, even if executed at runtime to you? Only the fact they aren't standard yet?

Non-Angular decorators are function wrappers, yes. But the structure and semantics of decorators, even the syntax can still change. Heck, decorators might never make it into the language (that language is ECMAScript, not TypeScript).

If syntax and semantics change, don't bet on TypeScript saving our behinds. When we use decorators in TypeScript, we enable the option "experimentalDecorators", meaning: "You're on your own, pal. Good luck!". It's called experimental for a reason (that reason is Angular by the way, there used to be this language called AtScript).

code of conduct - report abuse