Open SATBH opened 1 year ago
Hello @SATBH ,
Thanks for bringing this up. I don't think anyone have tried to use a function as message type. It should be possible to patch but were you thinking of using function just to avoid defining sum types?
I mean, I do think using a Sum type is the better choice. I just was playing around mostly, since i'm currently learning purescript and flame. And wanted to edit the model loosely cause i didn't want to plan ahead for the most part and discovered the bug. If it helps, wrapping the function in another type solves it. And sending a message with send
doesn't trigger it either. I am just opening the issue for robustness' sake mostly
The minimal reproducible example would be this.
I get that the point of messages is to limit the type of mutations one can do on the model. But I was playing around with that, since it allows me to try some things faster while i decide how to structure the state and its mutations. Trying this however fails, and when the button is clicked the following error is logged
Is this known?