Przeglądaj źródła

Remove x-cloak in the same tick

Caleb Porzio 3 lat temu
rodzic
commit
837397a06c
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      packages/alpinejs/src/directives/x-cloak.js

+ 1 - 2
packages/alpinejs/src/directives/x-cloak.js

@@ -1,5 +1,4 @@
 import { directive, prefix } from '../directives'
 import { directive, prefix } from '../directives'
 import { mutateDom } from '../mutation'
 import { mutateDom } from '../mutation'
-import { nextTick } from '../nextTick'
 
 
-directive('cloak', el => nextTick(() => mutateDom(() => el.removeAttribute(prefix('cloak')))))
+directive('cloak', el => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix('cloak')))))