Enjoyed ribs and rumps last night
Well a book I had been waiting to be released for sometime, Secrets of the JavaScript Ninja (John Resig), was released on the 14th January 2013.
I preordered this book 18 months ago and the other day I just got confirmation my copy is in the mail. I really hope it is worth the wait :)
I’ll put a review up once I have received and read the book.
I have been playing with backbonejs and CouchDB in my (limited) spare time to see how usable they are together.
Well I have a backbone collection and figured I would fetch a couch view into the collection. Now backbone expects an JSON array and couch gives you a single JSON object that has total and a rows etc.
Hmm…
I started to look around for someone on git that may have done this, not much luck. There were a couple of customisations that have been written but there were a few issues with using the latest backbone release.
I figured I’d start writing my own backbone extension that overrides the sync and fetch functions. I had already done a simple OData JSONP extension for work so I got started.
Then something in the back of my mind said ….list….
I realised you didn’t need to modify backbone, I could use a list function in couch. I even found someone on stackoverflow that had already written one (WIN)
The more I think about it couch is designed to do things like this, it will add in etags to help cache the list and I can even modify the list to handle different content types.
Hope this helps in some way.