helm icon indicating copy to clipboard operation
helm copied to clipboard

Change `subscriptionsFn` to take a model as an argument

Open astynax opened this issue 8 years ago • 5 comments

Closes #116

astynax avatar Oct 15 '17 19:10 astynax

@z0w0 you are right, subscriptions should react on model changes. I'll try to dig in this direction

astynax avatar Oct 16 '17 05:10 astynax

@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 :)

z0w0 avatar Oct 18 '17 09:10 z0w0

But if you call subscriptionsFn, how this new SignalGen replace the old one inside running Elerea's graph?

astynax avatar Oct 18 '17 09:10 astynax

Hmm, true. It would generate a new graph every time. Probably not ideal.

z0w0 avatar Oct 18 '17 10:10 z0w0

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.

Ulrar avatar Dec 17 '17 16:12 Ulrar