Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Get heart beat every 10 seconds
- vm.$nextTick(function () {
- window.setInterval(() => {
- vm.getBPM();
- },10000);
- })
- //Check if data is being received and get heart rate
- getBPM(){
- var vm = this;
- axios.get('((API CALL))')
- .then(function (response) {
- vm.data = response.data;
- vm.bpm = response.data[response.data.length - 1].bpm;
- if (vm.getSecondsToday() - vm.calcSeconds(response.data[response.data.length - 1].timestamp) > 20) {
- vm.recieving = false;
- }
- else {
- vm.recieving = true;
- }
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement