It depends what kind of 'switch' you want to have... take a look at hall-effect-applications. It may give you some ideas. For the actual device it matters what additional electronics it has built in transforming the hall effect. For some applications you want to have it work as a switch - digital - and for some you want to have it as a gradual measurement - analog - and either behavior plus additional one is the additional electronics measuring the magnetic flux.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It depends what kind of 'switch' you want to have... take a look at hall-effect-applications. It may give you some ideas. For the actual device it matters what additional electronics it has built in transforming the hall effect. For some applications you want to have it work as a switch - digital - and for some you want to have it as a gradual measurement - analog - and either behavior plus additional one is the additional electronics measuring the magnetic flux.