[Pas2js] Detect DOM changes with Mutation Observers

Michael Van Canneyt michael at freepascal.org
Sat Jun 30 14:42:32 CEST 2018



On Sat, 30 Jun 2018, warleyalex via Pas2js wrote:

> Michael Van Canneyt wrote
>> I have added it to the web.pas unit, but I changed the declaration
>> somewhat.
>> - Changed init structure to record. (there is still an overload with
>> TJSObject)
>
> When I pass a config object parameter for the observer, such as
> {"childList": true, "attributes": true} 
> I prefer to use the structure external class inherited from TJSObject
> instead of record, like in the following example:
>

Indeed. That is why I left the TJSObject overload; You can use
New(['attributes',true])
syntax to create such an object.

Michael.


More information about the Pas2js mailing list