Many thanks for your prompt reply. I'll look at your code. Absolutely I agree with you, to involve people in playing with Play, it is very important to have the possibility to look at the content of the whole stack, as well as, to have the possibility to clear it. Using these features inside of the Factor's Listener gave me the opportunity to understand more easily the effects of my code. Best, m
Thanks,
I looked and tested the code (for init and update, not view, as it seems not possible to use Html now).
I wrote a main fx to test the code. I attach the code here:
deftype: Model
: count Int
defunion: Msg
: Inc
: Dec
deftype: Inc
deftype: Dec
def: init
type: -- Model
: 9 >Model
def: inc
type: Int -- Int
: 1 +
def: dec
type: Int -- Int
: 1 -
defmulti: update
type: Msg Model -- Model
when: Inc
swap drop # get rid of message
dup count> inc >count
when: Dec
swap drop
dup count> dec >count
def: main
type: -- Int
entry: true
: init >Dec swap update count>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Many thanks for your prompt reply. I'll look at your code. Absolutely I agree with you, to involve people in playing with Play, it is very important to have the possibility to look at the content of the whole stack, as well as, to have the possibility to clear it. Using these features inside of the Factor's Listener gave me the opportunity to understand more easily the effects of my code. Best, m
Thanks,
I looked and tested the code (for init and update, not view, as it seems not possible to use Html now).
I wrote a main fx to test the code. I attach the code here:
deftype: Model
: count Int
defunion: Msg
: Inc
: Dec
deftype: Inc
deftype: Dec
def: init
type: -- Model
: 9 >Model
def: inc
type: Int -- Int
: 1 +
def: dec
type: Int -- Int
: 1 -
defmulti: update
type: Msg Model -- Model
when: Inc
swap drop # get rid of message
dup count> inc >count
when: Dec
swap drop
dup count> dec >count
def: main
type: -- Int
entry: true
: init >Dec swap update count>