Message from JavaScript talks

June 2017

— Pretty much everything will be in a Flux action, no matter what, it will be very smooth when it's done. I also invented a way for view components to reach into datastore state without running data through the datastore, with what I call Immediate Mode view components. It pulls from the view domain's stored state and also allows for outside parameters to be passed in, breaking some Flux rules but allowing very fast reaction times

Message permanent page

— 

So for highlighting objects with the mouse, the view component doing the highlighting has to know a few things like what kind of object it is etc... I previously ran that action through the datastore, but the propagation time to the component was too slow to support someone moving their mouse around.

— So the immediate mode component accepts a parameter of where the mouse is from the event handler, does some conditional based off what object that is in it's own state (not from presentation state) and then highlights or ignores the object based on the result, all without interacting with the datastore but while still using it's state. in "normal" Flux you would pass that parameter all the way through the datastore

Message permanent page

— So all an immediate view component is, is a component with a special render function which accepts a single parameter

Message permanent page

— 

// We use `this` here because Traviso sets it as the event target...

  obj.mouseover = function () {

    d_selection.immediateRender("highlightObject", this);

};

Message permanent page

— Interesting, I haven't used Flux

— The caveat is you can't invoke it directly... the view domain controlling the component must do so, hence the string in that function call

Message permanent page

— So you basically tell the view domain "render this component with your state and this parameter I am giving you"

Message permanent page

— The magic this allows is untouched immutable state, fully being handled for you

— Very fancy

— Along with that both the component and view domain must be marked as "immediate mode" explictly

— It's good to be explicit about breaking Flux rules :P