home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1530822437

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/pull/2052#issuecomment-1530822437 https://api.github.com/repos/simonw/datasette/issues/2052 1530822437 IC_kwDOBm6k_c5bPn8l 193185 2023-05-02T03:35:30Z 2023-05-02T16:02:38Z CONTRIBUTOR

Also, just checking - is this how I'd write bulletproof plugin registration code that is robust against the order in which the script tags load (eg if both my code and the Datasette code are loaded via a <script async src='...'/> tag)?

```js if (window.DATASETTE) go(window.DATASETTE); else document.addEventListener("datasette_init", (evt) => go(evt.detail));

function go(manager) { manager.registerPlugin(...) } ```

I don't know if it'd make sense, but you could also consider the asynchronous queuing pattern that Google Analytics uses (see this Stack Overflow post for more details):

```js DATASETTE = DATASETTE || []; DATASETTE.push(go);

function go(manager) { manager.registerPlugin(...); } ```

{
    "total_count": 2,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
1651082214  
Powered by Datasette · Queries took 2.423ms · About: github-to-sqlite