You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see this in my console: Overriding Ractive prototype function 'sort' without calling the '/\b_super\b/' method can be very dangerous.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
dzg
changed the title
Overriding Ractive prototype function 'sort'
"Overriding Ractive prototype function 'sort' without calling the '/\b_super\b/' method can be very dangerous."
Apr 10, 2019
It's creating an instance using the passed object as config. Certain properties become configuration for the instance (target, template, data), while the rest become instance properties and methods (sort).
Since sort is on the instance and is visible earlier on the prototype chain, it will "shadow" the sort method on the prototype. So whenever you call sort, it calls this method instead of the sort on the prototype.
If you know what you're doing, and you intend to replacesort for this instance, you can ignore the warning. But if you intend to extendsort, you'd call _super in your sort so that it calls the built-in sort in addition to running your version of sort.
I'm new to ractive and looking at the table sort tutorial at https://ractive.js.org/tutorials/iterative-sections/#step-5
I see this in my console: Overriding Ractive prototype function 'sort' without calling the '/\b_super\b/' method can be very dangerous.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: