Help Requiring Redux-Undo

I’ve been trying to require Redux-Undo with very limited success. Following Tom’s How To guide on requiring stubborn modules, I ended up with a script generated by bundle.run, which I successfully required in my notebook:
ReduxUndo = require(‘https://bundle.run/redux-undo@0.6.1’)
However, the object returned is a truncated version of the library without the “undoable” function, which is the main point of redux-undo.

Does anyone know how to require this library? Bonus points for requiring the 1.0.0 beta (bundle.run/redux-undo@latest defaults to 0.6.1)

Thanks in advance!

I’m not able to test this (since I’ve not used redux in Observable), but the following might work:

undoable = (await require('https://cdn.jsdelivr.net/npm/redux-undo@1.0.0-beta9-9-7/dist/redux-undo.js'))
  .default

The undoable function ends up as the .default key of the object returned when require resolves.

2 Likes

Thank you so much! That worked like a charm.
Here is the result, if you’re interested. I thanked you in the intro… please let me know if you’d rather I take that down.

1 Like