-
Notifications
You must be signed in to change notification settings - Fork 1
/
Store.js
40 lines (32 loc) · 1.06 KB
/
Store.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
/*
* This is a Catberry Cat-store file.
* More details can be found here
* https://github.com/catberry/catberry/blob/master/docs/index.md#stores-interface
*/
class __pascalName__ {
/**
* Creates a new instance of the "__pascalName__" store.
* @param {ServiceLocator} locator The service locator for resolving dependencies.
*/
constructor(locator) {
// In case you have the UHR plugin registered
// this._uhr = locator.resolve('uhr');
/**
* Current lifetime for data (in milliseconds) which the store is responsible for.
* @type {number} Lifetime in milliseconds.
*/
this.$lifetime = 60000;
}
load() {
// Here you can do any HTTP requests using this._uhr
// or another universal HTTP request implementation.
// Please read details here https://github.com/catberry/catberry-uhr.
}
handleSomeAction() {
// Here you can call this.$context.changed() if you know
// that remote data has been changed.
// Also, you can have other actions and handle methods like this, just define a method.
}
}
module.exports = __pascalName__;