title: StimulusJS How to set an instance variable on connect
body: <p>I am trying to get into stimulusJS</p>
  <pre><code>import { Controller } from 'stimulus'
  
  export default class extends Controller {
  
    static targets = [
      'foo',
    ]
  
    connect() {
      const fooValue = this.fooTarget.value
      console.log(this.fooValue) // 7
      this.someFunction()
    }
  
    someFunction(){
      console.log(this.fooValue) // undefined
    }
  
  }
  </code></pre>
  <p>I want to be able to get this value on connect as I want to know if it has changed.</p>