title: Is there a didSet/willSet analog in Kotlin?
body: <p>I love this Swift syntax; it's very helpful for many things:</p>
  
  <pre><code>var foo: Bar = Bar() {
      willSet {
          baz.prepareToDoTheThing()
      }
      didSet {
          baz.doTheThing()
      }
  }
  </code></pre>
  
  <p>and I'd love to do this in Kotlin. However, <a href="https://www.google.com/search?q=&quot;kotlin&quot;+didSet+willSet">I can't find the proper syntax</a>!</p>
  
  <p><strong>Is there anything in Kotlin like this?</strong></p>
  
  <pre><code>var foo: Bar = Bar()
      willSet() {
          baz.prepareToDoTheThing()
      }
      didSet() {
          baz.doTheThing()
      }
  </code></pre>