Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app-pouchdb-sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

```html
<app-pouchdb-sync
src="cats"
source="cats"
target="https://example.com:5678/cats"
bidirectional>
</app-pouchdb-sync>
Expand All @@ -39,22 +39,22 @@
properties: {
/**
* The source to sync from. If this sync is `bidirectional`, then the
* `src` and `target` values are interchangeable.
* `source` and `target` values are interchangeable.
*/
src: {
source: {
type: String
},

/**
* The `target` to sync to. If this sync is `bidirectional`, then the
* `src` and `target` values are interchangeable.
* `source` and `target` values are interchangeable.
*/
target: {
type: String
},

/**
* While `false`, synchronization will only happen from the `src` to the
* While `false`, synchronization will only happen from the `source` to the
* `target`. One-directional synchronization follows the semantics of
* `PouchDB.replicate`. Set to `true` to make the sync bidirectional,
* which uses `PouchDB.sync` instead.
Expand All @@ -70,7 +70,7 @@
*/
sync: {
type: Object,
computed: '__computeSync(src, target, bidirectional)',
computed: '__computeSync(source, target, bidirectional)',
observer: '__syncChanged'
},

Expand All @@ -84,14 +84,14 @@
}
},

__computeSync: function(src, target, bidirectional) {
__computeSync: function(source, target, bidirectional) {
var options = {
live: true,
retry: true
}
return bidirectional ?
PouchDB.sync(src, target, options) :
PouchDB.replicate(src, target, options);
PouchDB.sync(source, target, options) :
PouchDB.replicate(source, target, options);
},

__syncChanged: function(sync, oldSync) {
Expand Down