Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

How do I change the Enum value using ui? #25

Answered by setzer22
kkngsm asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! @kkngsm

The way the application works is by delaying side effects. In functions such as bottom_ui you should not modify the graph, because it's immutably borrowed. Instead, you add a response to the return value of your function with the necessary information to perform this side effect later on, when you have exclusive access to the graph.

To implement this, you need to create a custom response type that you can return from bottom_ui. To do this, you would need to add a new enum variant to MyResponse. For your particular use case, you probably want to create some sort of AddScalarProperty { id: NodeId } response variant (maybe you need to include additional data in it).

Then, you can…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kkngsm
Comment options

Answer selected by kkngsm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants