State Machine for CapacitorJS - handle events based on the current state, and easily switch between states.