You are reading a single comment by @andrewg_oz and its replies. Click here to read the full conversation.
  • Thanks. There is quite a bit to learn! Writing then seems straightforward:

    Util.showModal("Saving...");
    Puck.write(`\x10require("Storage").write­(${JSON.stringify("myapp.json")},${JSON.­stringify(settings)})\n`,()=>{
        Util.hideModal();
    });
    

    However, the documentation implies that Storage.read/write are different and not compatible with StorageFile.read/write, so the example read code using StorageFile is inconsistent with using Storage.write. From my reading of the Puck code, the callback of Puck.write doesn't take any arguments, so I'm guessing the following WONT work:

    Util.showModal("Loading...");
    Puck.write(`\x10require("Storage").read(­${JSON.stringify("myapp.json")})\n`,data­=>{
      Util.hideModal();
      settings = JSON.parse(data);
    });
    

    This is rather confusing. It's a shame I can't see a way to try this with the emulator. I think I'll have to be patient and wait for the actual Bangle to turn up.

About

Avatar for andrewg_oz @andrewg_oz started