Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

clock API documentation shows incorrect import

The API documentation at

https://dev.fitbit.com/reference/device-api/clock/

 

Shows the code

import { clock } from "clock";

clock.granularity = "minutes";

 

Putting this into a minimal project, building, and running on my ionic gives the error

>Unhandled TypeError: Cannot set property 'granularity' of undefined

 

If I instead change the import to not destructure, that is

 

import clock from "clock";

clock.granularity = "minutes";

Then the code behaves correctly. 

 

Other parts of the API documentation show destructuring when it is required, e.g. for display if you do not destructure then you get errors.

 

 

From display, this code is correct

import { display } from "display";
display.autoOff = false;
display.on = true;

 

Best Answer
1 REPLY 1

Thanks, a fix is on its way!

Best Answer
0 Votes