2.0+
Bond Live Counter
Live counter
A click counter can be generated easily by using the bond:click attribute in the bond component as below:

  bond('Posts')
                              
  <?php
  
  namespace spoova/mi/windows/Bond;

  use spoova/mi/core/classes/Bond;

  class Posts extends Bond{

    public $count = 0;

    public function render(): Compiler|String {

      return compile('bond-template');

    }

    public function increase() {

      $this->count++; //increase

    }

  }  
                              
  <div>

    <button bond:click="increase"> {{ $counter }} <button>
  
  </div>
                              
In the example above, when the button is clicked, the counter will increase and once the page is refreshed, the counter will reset to the default value.