Open KokoDoko opened 8 years ago
plus one! would be very useful.
Did anyone figure this out?
you can use setTimeout
I did in this project.
I am currently making a npm package from the current of this repo.
It appears that Tabletops internal Promise does not return tabletop
. You must include a callback
option, i.e.
function getSheetData(id) {
return new Promise(function (resolve) {
const options = {
key: id,
callback: (data, tabletop) => resolve({ data, tabletop });,
simpleSheet: true,
};
Tabletop.init(options);
});
}
Here's a more detailed description of the issue:
If a custom callback
isn't defined, it gets set to the resolve
function of the Promise. (See line 173).
This issue is that Promise.resolve only accepts one argument, but the callback function is being apply
-ed with two. (See line 449)
So: Tabletops callback API and the Promise API are incompatible.
I am willing to fix this issue, but the owner of this repo doesn't seem to be maintaining it anymore. Therefore, I'm providing this as forensic evidence to a future developer struggling with this issue. 🕵️
After calling
Tabletop.init(url, callback);
my google drive data is fetched and displayed in a html page. But at some point in the future, I need to reload the same data live, without refreshing the html page. I presumed I could callTabletop.fetch();
to do this but it seems thatTabletop.fetch();
causes a TypeError. Do I need to call init with the url and callback again?