-
Hi guys, looking for some help. I need to (preferably automatically) turn AST produced by esprima parser into an observable tree. The problem is that the parser produces class instances that are not under my control. Therefore the tree is not automatically transformed to observable as I would like. I could walk the tree and maybe call Also, I'm stuck at mobx@5 for now. Thank you for any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Solved by cloning the AST while omitting constructors. |
Beta Was this translation helpful? Give feedback.
-
Wondering if calling `makeAutoObservable(instance)` on every node
recursively would do the trick as well?
…On Wed, Sep 29, 2021 at 11:02 AM Jiří Brabec ***@***.***> wrote:
Solved by cloning the AST while omitting constructors.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBEQTOUXV52ZW4AFTBLUELP5BANCNFSM5E6BV72A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Sorry, that exists only on 6. reflection + extendObservable for every own
property would probably do the trick on 5.
On Wed, Sep 29, 2021 at 11:58 AM Michel Weststrate ***@***.***>
wrote:
… Wondering if calling `makeAutoObservable(instance)` on every node
recursively would do the trick as well?
On Wed, Sep 29, 2021 at 11:02 AM Jiří Brabec ***@***.***>
wrote:
> Solved by cloning the AST while omitting constructors.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#3124 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAN4NBEQTOUXV52ZW4AFTBLUELP5BANCNFSM5E6BV72A>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>
|
Beta Was this translation helpful? Give feedback.
Solved by cloning the AST while omitting constructors.