Fork me on GitHub
#funcool
<
2016-07-11
>
martinklepsch08:07:20

@niwinz: hey! I started reading the UXbox code, cool stuff 👍, were there any particular things that served as inspiration for the event abstractions?

niwinz08:07:37

hmm no, some ideas from elm

niwinz08:07:13

many ideas are own,

martinklepsch09:07:34

the WatchEvent is a clever idea and it's also nice that events can be Update+Watch in one because they're just protocols

niwinz09:07:17

yes, and the order always is

niwinz09:07:27

Update > Watch > Effect

niwinz09:07:44

so watch will receive the state already updated by the update

niwinz09:07:15

and watch receives the main stream so it can react to posterior events for cancel/abort stuff

niwinz09:07:10

tipical case for autocomplete backed by backend that allows cancel xhr requests if the user writes quickly

martinklepsch09:07:15

> and watch receives the main stream so it can react to posterior events for cancel/abort stuff I'm not sure I understand. Are WatchEvents cancelable? how? (maybe there's an example in the code?)

niwinz10:07:53

maybe it can serve as example

niwinz10:07:29

the basic is, in watch event you trigger some async stuff and in same time subscribe to main stream for watch if more events of same type are emited by the ui

niwinz10:07:52

so you can react old requests and leave only the most recent continue

niwinz10:07:00

in an hipotetical use case

martinklepsch11:07:58

ah ok, I see, saw the stoper thing before but didn't fully understand it's utility.

martinklepsch11:07:16

any reason you don't use positional record constructors?

niwinz11:07:16

I don't like its syntax

niwinz11:07:07

is just esthetic preference

niwinz11:07:53

about the other topic, maybe is not clear the purpose on simple view but is very very useful

niwinz11:07:25

for implement things like autocomplete backed by server returned results

niwinz11:07:01

you should be able cancel old requests in order to proceed with news ones on the user input...

niwinz11:07:09

and this allows do that