blender 2.8 refresh the graph editor after removing a modifier? I wrote the code below, in Blender 2.8, to remove fcurve modifiers from fcurves.

def main_step():
        obs = bpy.context.selected_objects
        for ob in obs:
            fc = ob.animation_data.action.fcurves
            for i in fc:
                for j in i.modifiers:
                    i.modifiers.remove(j) 


It works, but the actual animation will not update. Only after I touch some animation curve points with the mouse the animation will update.

Is there a way to 'refresh' or update the graph editor?
Ok, damn, figured it out. I added one line of code that fixed it.

i.modifiers.update()


So now the function looks like this, and it works:

def main_step():
    obs = bpy.context.selected_objects
    for ob in obs:
        fc = ob.animation_data.action.fcurves
        for i in fc:
            for j in i.modifiers:
                i.modifiers.remove(j)
            i.modifiers.update()