Skip to content

Instantly share code, notes, and snippets.

@dannoso
dannoso / .gitconfig
Last active February 27, 2017 09:16
My .gitconfig
[user]
name = Davide Lattanzio
email = info@dualweb.it
[push]
default = simple
[alias]
co = checkout
br = branch
brv = branch -avv
ci = commit
@dannoso
dannoso / fetcher.php
Created February 23, 2017 09:43
On demand, dynamic, invisible remote files fetcher
<?php
/*
* This is very useful when you have a broken html with missing files
* ie: you save an html page but you miss all the resources
*
* @author Davide Lattanzio
* @email info@dualweb.it
*
*/
I think the problem is that when you do that:
PlacesLocal.add(record.data);
There's an id field with a value in record.data. Hence, the record won't be considered new. It won't be considered modified either, because it has not be modified, and it won't be considered deleted either (the explaination is left as an exercice to the reader).
In other words, for the store, there's nothing to sync. Mission complete.
Here's the code of getNewRecords, that is used in the sync method:
function() {