These are chat archives for jdubray/sam

23rd
May 2017
devin ivy
@devinivy
May 23 2017 16:19

@jdubray i think you linked this earlier https://github.com/mobxjs/mobx-state-tree

this is beautiful!

this will allow us to manage state in a cohesive way across applications– e.g. react, relying on immutability for perf, and polymer, relying on mutability for performance.
Jean-Jacques Dubray
@jdubray
May 23 2017 16:52
well, I wish there would be the same convergence on what an action is, we are leaving a lot of value on the table by going back 40 years and treat that single-state-tree in an Object-Oriented-Way. @devinivy so far Vue is the only framework that understands that action != mutation.
I must admit I love bootstrap modals they make so much sense for a functional HTML model (V = f(M))
This message was deleted
I wish every bit of HTML was as declarative.
devin ivy
@devinivy
May 23 2017 17:37

we have the state tools, and the view tools, and neither of them consider it their responsibility to say specifically how state should be managed in an app. redux is a container– whether you use what they call actions as mutations or intents is sort of up to you.

while i appreciate that unifying our usage of these terms, i'm looking at things with more of an eye for how they might be useful. the fact that mobx-state-tree has a term "actions" doesn't mean to me that they must be for mutations or for intents.

what does vue do to practically separate action and mutation?
or is it just the terminology they use that you like?
(i don't mean to imply terminology isn't practical– but i do mean to separate praxis and terminology)
Jean-Jacques Dubray
@jdubray
May 23 2017 17:40
sure, the problem is as soon as you leave some room to choose one semantic or the other, inevitably lots of people will end up doing the a mish mash of both. There is no point in leaving that open.
devin ivy
@devinivy
May 23 2017 17:41
whose job would it be to nail that down– state-related libraries or view-related libraries? or meiosis ;) @foxdonut
(btw @foxdonut, a speaker came to my workplace talking about FRP and mentioned meiosis!! :D)
(i was very pleased)
@jdubray if you have some strong opinions about it, perhaps creating a "reactive UI terminology" repo to record and discuss this would be useful!
Jean-Jacques Dubray
@jdubray
May 23 2017 17:45
As I understand it, Vuex is doing it in a SAM oriented way:
const store = new Vuex.Store({
  state: {
    count: 0
  },
  mutations: {
    increment (state) {
      state.count++
    }
  },
  actions: {
    increment (context) {
      context.commit('increment')
    }
  }
})
devin ivy
@devinivy
May 23 2017 17:45
ah, i see
Jean-Jacques Dubray
@jdubray
May 23 2017 17:45
mutation manipulate the state, actions don't
Mutations are synchronized
devin ivy
@devinivy
May 23 2017 17:47
that is cool!
Jean-Jacques Dubray
@jdubray
May 23 2017 17:47
As I mentioned, I prefer a style that allows a many-to-many relationship between actions and mutations/acceptors/updates, but I'll take vuex anytime over the best reducer.
I'll try to produce a sample over the week-end to see how it looks like.
The action can also pass a p...roposal:
image.png
Fred Daoud
@foxdonut
May 23 2017 17:54
@devinivy wow that is cool, thanks for sharing? who was the speaker?
devin ivy
@devinivy
May 23 2017 17:54
so in the mutation you would perform, e.g., validation. and possibly "reject" the commit?
here are the slides @foxdonut http://slides.com/bahmutov/pure-magic#/
gleb bahmutov
here's the slide you're mentioned :) http://slides.com/bahmutov/pure-magic#/47/2
Jean-Jacques Dubray
@jdubray
May 23 2017 17:58
I assume so. The idea is really to separate clearly how you compute the new property values from committing the application state to change to these property values. Just like in an RDBMS, when you insert/update/delete, the database has no idea how you came up to these values. However, it's able to check the integrity of the changes you are requesting and accept/reject them. This pattern has been in effect for decades...
Fred Daoud
@foxdonut
May 23 2017 18:06
@devinivy thanks for sharing that, you made my day! :blush:
I am a fan of Gleb Bahmutov's work!