Refresh Function not working on List View

frappe.listview_settings[‘Test’] ={
onload : function(){
console.log(“working”)
},
refresh:function(){
console.log(‘not working’)
}
}

Whenever doctype get reloaded the custom script works for onload on shifting to listview but refresh doesnt work.
How can refresh function work/ trigger when list view of TEST doctype is opened.

or else I want calculate one field which is in list view and then show the updated values of it in list view after calculation.

How is that possible on list view of doctype through Custom script?