When I delete a qlik object from the dev-hub, any promise that is right next to it it doesn't get deleted, and throws me syntax error.
Example:
app.getObject('object-01', 'AdjhthZ').then(function(){
console.log('hey you!');
});
If i delete this object right from the 'preview' screen, it doesn't remove the '.then(....' line.
So, deleting from the preview, it keeps like this:
.then(function(){
console.log('hey you!');
});
Is there any way to achieve this 'automatic' delete?
Thanks!
Hey Jonas,
Just realized that the dev-hub doesn't actually look for the original content like you said, but it searches for the first occurrence of ';'
If you remove a object that is just like this:
app.getObject('obj1', 'objectId').then(function(){
console.log('hey')
});
It will remove all the lines, including console.log and the '})'.
If you remove
app.getObject('obj1', 'objectId').then(function(){
console.log('hey');
});
It will remove the two first lines, and the last will remain.
This feature not been implemented in dev-hub. The editor looks for the original content and any added content by the user will not be considered.
I see. Do you think it would interesting to develop this in the future? Since it's a property provided by the getObject method and it doesn't makes sense to keep the '.then(...' in the code.
Hey Jonas,
Just realized that the dev-hub doesn't actually look for the original content like you said, but it searches for the first occurrence of ';'
If you remove a object that is just like this:
app.getObject('obj1', 'objectId').then(function(){
console.log('hey')
});
It will remove all the lines, including console.log and the '})'.
If you remove
app.getObject('obj1', 'objectId').then(function(){
console.log('hey');
});
It will remove the two first lines, and the last will remain.
You are right. The intention is to look for the original content but since it is using regexp it find close matches. I will add your suggestion as an improvement suggestion.