1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Add startup() to store API

This commit is contained in:
Kegan Dougal
2017-02-17 10:14:12 +00:00
parent 29336e260c
commit c93c8a79b7
3 changed files with 19 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ describe("MatrixClient", function() {
"getRoom", "getRooms", "getUser", "getSyncToken", "scrollback", "getRoom", "getRooms", "getUser", "getSyncToken", "scrollback",
"save", "setSyncToken", "storeEvents", "storeRoom", "storeUser", "save", "setSyncToken", "storeEvents", "storeRoom", "storeUser",
"getFilterIdByName", "setFilterIdByName", "getFilter", "storeFilter", "getFilterIdByName", "setFilterIdByName", "getFilter", "storeFilter",
"getSyncAccumulator", "getSyncAccumulator", "startup",
].reduce((r, k) => { r[k] = expect.createSpy(); return r; }, {}); ].reduce((r, k) => { r[k] = expect.createSpy(); return r; }, {});
client = new MatrixClient({ client = new MatrixClient({
baseUrl: "https://my.home.server", baseUrl: "https://my.home.server",

View File

@@ -21,6 +21,7 @@ limitations under the License.
*/ */
const utils = require("../utils"); const utils = require("../utils");
const User = require("../models/user"); const User = require("../models/user");
const q = require("q");
/** /**
* Construct a new in-memory data store for the Matrix Client. * Construct a new in-memory data store for the Matrix Client.
@@ -288,4 +289,12 @@ module.exports.MatrixInMemoryStore.prototype = {
getSyncAccumulator: function() { getSyncAccumulator: function() {
return null; return null;
}, },
/**
* Startup does nothing as this store doesn't require starting up.
* @return {Promise} An immediately resolved promise.
*/
startup: function() {
return q();
},
}; };

View File

@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
"use strict"; "use strict";
import q from "q";
/** /**
* This is an internal module. * This is an internal module.
* @module store/stub * @module store/stub
@@ -193,6 +194,14 @@ StubStore.prototype = {
getSyncAccumulator: function() { getSyncAccumulator: function() {
return null; return null;
}, },
/**
* Startup does nothing.
* @return {Promise} An immediately resolved promise.
*/
startup: function() {
return q();
},
}; };
/** Stub Store class. */ /** Stub Store class. */