See this example project I created on this website: the last “cell” (? not sure if that’s the proper word) is equal to an empty array. You can see the same example on codesandbox where the equivalent line produces an array containing a single date (the expected result). Without delving into whether there is a bug with my library (I don’t think there is in this case), hopefully we can all agree that these two examples should produce the same result.
Figured someone would want me to report this.
ps: you can find a link to the rSchedule repo on the “Observable” example I created, as well as by looking at the npm modules in the codesandbox example.
Promises and dependency injection should work. I also recommend reading
The cell has an explicit dependency on schedule, so schedule is guaranteed to run first. What happens after (or inside) is up the script (unless you return a promise). However, the last cell is not guaranteed to run last.
Please also make sure that both the sandbox and the notebook pull in the exact same scripts, from the exact same sources. The best way to verify (in my opinion) is to check the network tab in your browser’s developer tools.
The reason this passes on CodeSandbox is that you pinned the version of rschedule to 0.11.0. If you upgrade to 0.11.1 or 0.11.2 you should see the same bug. Edit: here is a suggestion to pin the version.