1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Add getSyncToken and setSyncToken to data store interface.

This allows local storage to hold onto the token across page refreshes.
This commit is contained in:
Kegan Dougal
2015-06-26 15:36:53 +01:00
parent 6078100465
commit b7975866fa
5 changed files with 57 additions and 8 deletions

View File

@@ -5,15 +5,31 @@
*/
/**
* Construct a stub store. This does no-ops on all store methods.
* Construct a stub store. This does no-ops on most store methods.
* @constructor
*/
function StubStore() {
this.fromToken = null;
}
StubStore.prototype = {
/**
* Get the sync token.
* @return {string}
*/
getSyncToken: function() {
return this.fromToken;
},
/**
* Set the sync token.
* @param {string} token
*/
setSyncToken: function(token) {
this.fromToken = token;
},
/**
* No-op.
* @param {Room} room