Typescript Call Function From Variable Resistor