Open astynax opened 6 years ago
@z0w0 you are right, subscriptions should react on model changes. I'll try to dig in this direction
@astynax should be able to change stepAction
in Helm.hs
to change actionSmp
to be the result of calling subscriptionsFn
with the updatedModel
.
Let me know if you'll have the time to do that, otherwise I'll merge and adjust that myself :)
But if you call subscriptionsFn
, how this new SignalGen
replace the old one inside running Elerea's graph?
Hmm, true. It would generate a new graph every time. Probably not ideal.
I might be off here, but if the goal is to allow changing subscriptions at runtime, wouldn't be simpler to just allow the use of a Cmd to either delete / create a subscription, or to request the call to the subscription function (i.e. Cmd.updateSubscriptions) ? That way subscriptions would be re-calculated only when needed.
Closes #116