0

Is there any way to catch the changes of variable in typescript?

I need to call the methods immediately when variable is changed.

Is it possible to do this?

Ihor
  • 53
  • 8
  • 1
    We need a bit more context for this,but if you have a class field you could use a property instead of a field – Titian Cernicova-Dragomir Aug 13 '18 at 16:17
  • 2
    This is a runtime feature; TypeScript doesn't add new runtime capabilities. You should be looking at the existing questions about this in the `javascript` tag – Ryan Cavanaugh Aug 13 '18 at 16:17
  • 2
    TypeScript = JavaScript + type system + early adoption of upcoming features + public/private stuff that will never be part of JavaScript. So since none of that relates to watching variable changes, I've linked a question about doing so in JavaScript, since it applies. :-) – T.J. Crowder Aug 13 '18 at 16:19

0 Answers0