anvilistas / anvil-labs

MIT License
9 stars 3 forks source link

Documentation error for Web Worker #142

Closed rhurlbatt closed 11 months ago

rhurlbatt commented 11 months ago

The Web Worker example code fails on this function:

def button_1_click(self, **event_args):
        self.task = my_worker.launch_task("fib", 2**20)
        self.timer.interval = 1
        my_worker.on_result(self.fib_result) # Fails here
        my_worker.on_error(self.fib_error) # Fails here
        # my_worker.on_state_change(self.fib_state_change)

Changing this to frommy_worker to self.task produces the correct result.

I will create a PR for this.