In bootstrap 3 fixSpy() routines show that scrollspy offset is set as follows:
data = $'bs.scrollspy');
data.options.offset = offset;

In bootstrap 4 the statement above gives:
TypeError: undefined is not an object (evaluating 'data.options.offset = offset')

What is has changed in bs4 bs.scrollspy and what is the new way to set the offset using a fixSpy()?