单突变
通过MutationObserver观察一个突变,然后解决一个Promise。
安装
npm install one-mutation
// This module is only offered as a ES Module
import oneMutation from 'one-mutation' ;
用法
oneMutation ( document . body , { childList : true } ) . then ( mutations => {
// A text node was added!
} ) ;
document . body . append ( 'Text' ) ;
oneMutation ( document . body , {
childList : true ,
filter : mutations => mutat
评论0
最新资源