Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Christian Maher
@cmaher
and be more react-y
Gary Kaganas
@Seebiscuit
How can diffing your entire APP be efficent? I get that repaints are costly, but I find it hard to swallow that if one field changes in my app, I have to re-diff the entire thing. The DOM could contain many thousand nodes...
Btw, just to make sure, I never asked you. If I don't set a ttl recipe, and I use, say localStorage, the data will live there forever, right?
Christian Maher
@cmaher
it should
In reality, I don't think many people end up diffing their whole app
Gary Kaganas
@Seebiscuit
I thought that's what "One App State" was all about.
Christian Maher
@cmaher
it is, but the way apps generally go is that there are a bunch of different subapps
it can also be made really efficient with immutable data
that's what Om does
Gary Kaganas
@Seebiscuit
How does immutable data work?
Christian Maher
@cmaher
you just compare reference
which is really fast
Gary Kaganas
@Seebiscuit
Well that is nice
Gary Kaganas
@Seebiscuit
How hard do you think it'll be to port Conductor to React?
Rui Costa
@ruicosta042
just my two cents on the Backbone - React integration.. i've been looking at it and am looking forward to incorporate React components with Marionette.Views
if you look at this doc: http://facebook.github.io/react/docs/thinking-in-react.html, you'll see a very direct relationship on React's UI component hierarchy and the way Marionette arranges its views (LayoutView, CollectionView and ItemView)
I would say React.js can be the template engine to Marionette.Views
Gary Kaganas
@Seebiscuit
Thanks @ruicosta042
Any advice on using Flux in Backbone?
Christian Maher
@cmaher
I think there's actually been some discussion about that in the past @ruicosta042
can't quite find the issue, but there was also some experimentation with virtual dom
Rui Costa
@ruicosta042
@cmaher this virtual dom? https://github.com/Matt-Esch/virtual-dom
that would be a cleaner implementation, as i reckon you could still use backbone.events on the views, while if using React, some heavy tickering would be involved to capture said events
@Seebiscuit i haven't looked into Flux, my first reaction would be they do the same stuff?
Christian Maher
@cmaher
I think so. There were some experiments with it, but I don't really remember how they turned out
Gary Kaganas
@Seebiscuit
@cmaher noticed a new release. What's new?
Gary Kaganas
@Seebiscuit
@cmaher thinking about the options that can be passed into Collection fetch (like {add: false}, {remove: false}, or {merge: false}).
It would make sense that Hoard should follow these too...Maybe?
Christian Maher
@cmaher
Nothing really new, just a bit of cleanup. I think I want to avoid those collection options, because hoard should basically just be a proxy for fetch
Gary Kaganas
@Seebiscuit
As a cache though, I think it should mirror the intended request. If I pass { add: true }and my current collection now has more models than the request, the cache will be out of sync...
Trezy
@trezy
What’s the best way to handle it if I want to change Hoard.backend for just one model?
In this case, I want to use the default Hoard behavior for all of the data stored in my own API, but I want to stick data from the Twitter steaming API into localStorage.
I haven’t been able to find any info by Googling thus far.
The only thing I can come up with is to create a separate instance of Hoard for the Tweet model.
But I wanted to see if anybody had a better way. :-)
Gary Kaganas
@Seebiscuit
This is probably not the solution you're looking for @trezy , but since Hoard only requires your backend to implement getItem and a setItem methods, you could override your getter method like:
var backend = this.myBackend;
...
get: function (key) {
  if (key.indexOf('twitter' ) >  -1) {
    // localStorage implementation
  }
  return backend.getItem(key);
},
set: function (key, value) {
  if (key.indexOf('twitter' ) >  -1) {
    // localStorage implementation
  }
  return backend.setItem(key,value);
},
This message was deleted
Trezy
@trezy
@Seebiscuit Would that be any different then just setting Hoard.backend to localStorage?
Trezy
@trezy
OH
Nevermind
I’m a dork.
I didn’t even notice the indexOf you’re doing. X-D
Gary Kaganas
@Seebiscuit
But you know, there's little cost to just initializing a second instance of Hoard. Like you first mentioned
That's probably best practice, IMHO
Trezy
@trezy
Yeah, that’s what I’m doing right now, I was mostly just curious if that was the recommended way or if there was another option. :-)
Gary Kaganas
@Seebiscuit
I really wonder what @cmaher thinks. Sadly, there hasn't developed a huge community around Hoard, even tho it's like the tightest client-side cache solution I've worked with. At least not big enought to establish best practices.
Trezy
@trezy
Fo shiz.
I’ve been using it for quite a while and I love it.
:-)
Victor
@engineervix
Howdy folks!