Skip to content

How to represent callbacks in WASI? #669

@npetrangelo

Description

@npetrangelo

I'm looking to create a Signal engine like how SolidJS works, with a WASI interface. The way Solid handles dependency tracking is the provided callback is called once during declaration and the getters add the callback as a dependency of their signals, using a global variable to store the callback for the getters to reference. To implement this kind of functionality, I need to implement callbacks. In other words, the engine will provide a createEffect() function that a wasm component will use by passing in the callback to invoke whenever the signals update. Since WASI doesn't seem to support functions as parameters directly, what's the best way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions