Skip to content

Access evaluated context from an added function #33

@jaenyf

Description

@jaenyf

Problem

Hi Dan, thanks for your great work !
I'm trying to use bonsai-js with a static bonsai instance that run (preload) addFunction for my every well-known functions. This instance will also compile further expressions. Each of these expressions will run with a well-known context object.

Nevertheless, I didn't figured out a way to access context values passed in compiledExpression.evaluateSync() from my added function. I ended up passing arguments to these functions from my context but this makes syntax quite unreadable and heavy as the whole thing is less maintainable.

My question, is, is there a way to access a context given in evaluateSync from previously added functions. If yes how ?
If not, would you plan to add it ?

Thanks again

Proposed solution

No response

Alternatives considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions