Closed wan-liyang closed 5 years ago
@marcj , Hi bro, thank you, today i'm fixing one issue of my project use this css-element-queries, and achieve what i want. but sometime need pass prepared object to callback function, and cannot find provided function. so i made this changes.
Why don't you just do
const params = {foo: 'bar'};
function callback(szie, params) {}
new ResizeSensor(jQuery('#id'), (size) => {callback(size, params)});
?
So stupid😞, thank you for correct me.
Add params as parameter of new ResizeSensor() and pass params to callback, so that can use following code to pass and get the specific parameter. /pass whatever you want to pass to callback/ new ResizeSensor(jQuery('#id'), callback, params);
function callback(size, params) { }