Ale.js

# Async DOM

### Introduction

In version 1.0.0 and later, we allow you to update the DOM using asynchronous queues, which means higher performance.

For example, we have a component that needs to be updated cyclically:

The component of the above instance will trigger a 10000 component view update in version 1.0-beta.1, and it will only be updated once, the last one in version 1.0.0+.

#### nextTick

But that means we can’t use innerHTML to get the content in the component, because we can’t detect when it’s finished updating.

Although Ale encourages developers to think alongside data-driven thinking. But I have to admit that sometimes you do need to get the component’s innerHTML. At this point you can use the Ale.nextTick function to add a callback function to Ale’s asynchronous DOM update queue:

At this point you can get the innerHTML of the component: