GigaTables/reactables

Hoek.applyToDefaults breaks promise passed in ajax property!!!

MichaelF77 opened this issue · 1 comments

Spend many hours trying to figure out why does not the latest version work with promise passed as ajax, turns out it's due to the change from

this.settings = loAssign({}, this.defaultSettings, this.props.settings);
to
this.settings = Hoek.applyToDefaults(this.defaultSettings, this.props.settings);

The Hoek call breaks Promise passed in ajax!! Please fix it asap.

To reproduce:
replace
ajax: 'http://example.com/your/tabledata'
with
ajax: new Promise( (resolve) => resolve('http://example.com/your/tabledata'))

To fix (tested by doing it locally):
add following line after
this.settings = Hoek.applyToDefaults(this.defaultSettings, this.props.settings);
this.settings.ajax = this.props.settings.ajax;