@wix/site-service-site-info 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/cjs/build/definition/index.d.ts +24 -10
- package/cjs/build/definition/index.js +1 -0
- package/cjs/build/definition/index.js.map +1 -1
- package/cjs/build/implementations/siteInfoService.js +10 -10
- package/cjs/build/implementations/siteInfoService.js.map +1 -1
- package/dist/definition/index.d.ts +24 -10
- package/dist/definition/index.js +1 -0
- package/dist/definition/index.js.map +1 -1
- package/dist/implementations/siteInfoService.js +10 -10
- package/dist/implementations/siteInfoService.js.map +1 -1
- package/package.json +2 -2
- package/src/definition/index.ts +24 -10
- package/src/implementations/siteInfoService.ts +10 -10
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ import { SiteInfoDefinition } from '@wix/site-service-site-info/definition'
|
|
|
15
15
|
|
|
16
16
|
const siteInfo = servicesManager.getService(SiteInfoDefinition)
|
|
17
17
|
|
|
18
|
-
siteInfo.
|
|
19
|
-
siteInfo.
|
|
18
|
+
siteInfo.name // 'My Bakery'
|
|
19
|
+
siteInfo.revision // 42
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Read through the service object, not a destructured copy: a destructured value doesn't see later updates.
|
|
@@ -27,8 +27,8 @@ Declare `'@wix/site-service-site-info'` in your component's `serviceDependencies
|
|
|
27
27
|
|
|
28
28
|
| Member | Type | Throws when | Description |
|
|
29
29
|
|---|---|---|---|
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
30
|
+
| `name` | `string` | never | Display name of the site, as set in the site's settings. `''` when the site has none. Same value as [`site.getSiteDisplayName()`](https://dev.wix.com/docs/sdk/frontend-modules/site/get-site-display-name). |
|
|
31
|
+
| `revision` | `number` | never | Revision of the site that is being rendered. `0` when there is no revision. |
|
|
32
32
|
| `_updateConfig` | `(Partial<ISiteInfoServiceConfig>) => void` | never | Private replace-on-write updater for provided fields. |
|
|
33
33
|
|
|
34
34
|
## Configuration
|
|
@@ -37,12 +37,12 @@ Declare `'@wix/site-service-site-info'` in your component's `serviceDependencies
|
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
39
|
type ISiteInfoServiceConfig = {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
name: string
|
|
41
|
+
revision: number
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Injected by the host. `
|
|
45
|
+
Injected by the host. `name` comes from the site's properties, and `revision` from the published site. The host passes `0` when it has no revision.
|
|
46
46
|
|
|
47
47
|
## Reactivity
|
|
48
48
|
|
|
@@ -6,36 +6,50 @@ export type ISiteInfoServiceConfig = {
|
|
|
6
6
|
*
|
|
7
7
|
* @exampleValue 'My Bakery'
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
name: string;
|
|
10
10
|
/**
|
|
11
11
|
* Revision of the site that is being rendered. `0` when the host has no revision.
|
|
12
12
|
*
|
|
13
13
|
* @exampleValue 42
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
revision: number;
|
|
16
16
|
};
|
|
17
|
-
/**
|
|
17
|
+
/** Reports the display name and revision number of the site your code runs on. */
|
|
18
18
|
export interface ISiteInfoService {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Site's display name.
|
|
21
|
+
*
|
|
22
|
+
* A Wix user sets it in the Website Settings section of the site's dashboard.
|
|
23
|
+
*
|
|
24
|
+
* This value can change while the page is open. It changes when a Wix user renames the site while
|
|
25
|
+
* editing it. Read it while a component renders, or inside an `effect` or `computed`, to react to
|
|
26
|
+
* changes.
|
|
21
27
|
*
|
|
22
28
|
* `''` when the site has no display name.
|
|
23
29
|
*
|
|
24
|
-
* @exampleValue '
|
|
30
|
+
* @exampleValue 'Example Outfitters'
|
|
25
31
|
*/
|
|
26
|
-
readonly
|
|
32
|
+
readonly name: string;
|
|
27
33
|
/**
|
|
28
|
-
*
|
|
34
|
+
* Site's revision number.
|
|
35
|
+
*
|
|
36
|
+
* The site gets a new revision each time a Wix user saves or publishes it after a change.
|
|
37
|
+
*
|
|
38
|
+
* This value can change while the page is open. It changes when the site gets a new revision while a
|
|
39
|
+
* Wix user is editing it. Read it while a component renders, or inside an `effect` or `computed`, to
|
|
40
|
+
* react to changes.
|
|
29
41
|
*
|
|
30
|
-
* `0` when
|
|
42
|
+
* `0` when no revision is available.
|
|
31
43
|
*
|
|
32
44
|
* @exampleValue 42
|
|
33
45
|
*/
|
|
34
|
-
readonly
|
|
35
|
-
/**
|
|
46
|
+
readonly revision: number;
|
|
47
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
36
48
|
_updateConfig: (config: Partial<ISiteInfoServiceConfig>) => void;
|
|
37
49
|
}
|
|
50
|
+
/** Definition of the Site Info service, used to resolve it from the services manager. */
|
|
38
51
|
export type ISiteInfoDefinition = ServiceDefinition<ISiteInfoService, ISiteInfoServiceConfig>;
|
|
52
|
+
/** Definition of the Site Info service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
39
53
|
export declare const SiteInfoDefinition: string & {
|
|
40
54
|
__api: ISiteInfoService;
|
|
41
55
|
__config: ISiteInfoServiceConfig;
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SiteInfoDefinition = void 0;
|
|
4
4
|
const services_definitions_1 = require("@wix/services-definitions");
|
|
5
|
+
/** Definition of the Site Info service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
5
6
|
exports.SiteInfoDefinition = (0, services_definitions_1.defineService)('@wix/site-service-site-info');
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAwDzD,2GAA2G;AAC9F,QAAA,kBAAkB,GAAG,IAAA,oCAAa,EAA2C,6BAA6B,CAAC,CAAA"}
|
|
@@ -6,21 +6,21 @@ const signals_1 = require("@wix/services-definitions/core-services/signals");
|
|
|
6
6
|
const definition_1 = require("../definition");
|
|
7
7
|
exports.SiteInfoService = (0, services_definitions_1.implementService)(definition_1.SiteInfoDefinition, ({ config, getService }) => {
|
|
8
8
|
const { signal } = getService(signals_1.SignalsServiceDefinition);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const _name = signal(config.name);
|
|
10
|
+
const _revision = signal(config.revision);
|
|
11
11
|
return {
|
|
12
|
-
get
|
|
13
|
-
return
|
|
12
|
+
get name() {
|
|
13
|
+
return _name.get();
|
|
14
14
|
},
|
|
15
|
-
get
|
|
16
|
-
return
|
|
15
|
+
get revision() {
|
|
16
|
+
return _revision.get();
|
|
17
17
|
},
|
|
18
18
|
_updateConfig(update) {
|
|
19
|
-
if (typeof update.
|
|
20
|
-
|
|
19
|
+
if (typeof update.name !== 'undefined') {
|
|
20
|
+
_name.set(update.name);
|
|
21
21
|
}
|
|
22
|
-
if (typeof update.
|
|
23
|
-
|
|
22
|
+
if (typeof update.revision !== 'undefined') {
|
|
23
|
+
_revision.set(update.revision);
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteInfoService.js","sourceRoot":"","sources":["../../../src/implementations/siteInfoService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAkD;AAErC,QAAA,eAAe,GAAG,IAAA,uCAAgB,EAC9C,+BAAkB,EAClB,CAAC,EAAE,MAAM,EAAE,UAAU,EAA8C,EAAoB,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAwB,CAAC,CAAA;IACvD,MAAM,
|
|
1
|
+
{"version":3,"file":"siteInfoService.js","sourceRoot":"","sources":["../../../src/implementations/siteInfoService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAkD;AAErC,QAAA,eAAe,GAAG,IAAA,uCAAgB,EAC9C,+BAAkB,EAClB,CAAC,EAAE,MAAM,EAAE,UAAU,EAA8C,EAAoB,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAwB,CAAC,CAAA;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAEzC,OAAO;QACN,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,GAAG,EAAE,CAAA;QACnB,CAAC;QACD,IAAI,QAAQ;YACX,OAAO,SAAS,CAAC,GAAG,EAAE,CAAA;QACvB,CAAC;QACD,aAAa,CAAC,MAAuC;YACpD,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBACxC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACvB,CAAC;YACD,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;gBAC5C,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC/B,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
|
|
@@ -6,36 +6,50 @@ export type ISiteInfoServiceConfig = {
|
|
|
6
6
|
*
|
|
7
7
|
* @exampleValue 'My Bakery'
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
name: string;
|
|
10
10
|
/**
|
|
11
11
|
* Revision of the site that is being rendered. `0` when the host has no revision.
|
|
12
12
|
*
|
|
13
13
|
* @exampleValue 42
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
revision: number;
|
|
16
16
|
};
|
|
17
|
-
/**
|
|
17
|
+
/** Reports the display name and revision number of the site your code runs on. */
|
|
18
18
|
export interface ISiteInfoService {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Site's display name.
|
|
21
|
+
*
|
|
22
|
+
* A Wix user sets it in the Website Settings section of the site's dashboard.
|
|
23
|
+
*
|
|
24
|
+
* This value can change while the page is open. It changes when a Wix user renames the site while
|
|
25
|
+
* editing it. Read it while a component renders, or inside an `effect` or `computed`, to react to
|
|
26
|
+
* changes.
|
|
21
27
|
*
|
|
22
28
|
* `''` when the site has no display name.
|
|
23
29
|
*
|
|
24
|
-
* @exampleValue '
|
|
30
|
+
* @exampleValue 'Example Outfitters'
|
|
25
31
|
*/
|
|
26
|
-
readonly
|
|
32
|
+
readonly name: string;
|
|
27
33
|
/**
|
|
28
|
-
*
|
|
34
|
+
* Site's revision number.
|
|
35
|
+
*
|
|
36
|
+
* The site gets a new revision each time a Wix user saves or publishes it after a change.
|
|
37
|
+
*
|
|
38
|
+
* This value can change while the page is open. It changes when the site gets a new revision while a
|
|
39
|
+
* Wix user is editing it. Read it while a component renders, or inside an `effect` or `computed`, to
|
|
40
|
+
* react to changes.
|
|
29
41
|
*
|
|
30
|
-
* `0` when
|
|
42
|
+
* `0` when no revision is available.
|
|
31
43
|
*
|
|
32
44
|
* @exampleValue 42
|
|
33
45
|
*/
|
|
34
|
-
readonly
|
|
35
|
-
/**
|
|
46
|
+
readonly revision: number;
|
|
47
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
36
48
|
_updateConfig: (config: Partial<ISiteInfoServiceConfig>) => void;
|
|
37
49
|
}
|
|
50
|
+
/** Definition of the Site Info service, used to resolve it from the services manager. */
|
|
38
51
|
export type ISiteInfoDefinition = ServiceDefinition<ISiteInfoService, ISiteInfoServiceConfig>;
|
|
52
|
+
/** Definition of the Site Info service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
39
53
|
export declare const SiteInfoDefinition: string & {
|
|
40
54
|
__api: ISiteInfoService;
|
|
41
55
|
__config: ISiteInfoServiceConfig;
|
package/dist/definition/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { defineService } from '@wix/services-definitions';
|
|
2
|
+
/** Definition of the Site Info service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
2
3
|
export const SiteInfoDefinition = defineService('@wix/site-service-site-info');
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAwDzD,2GAA2G;AAC3G,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAA2C,6BAA6B,CAAC,CAAA"}
|
|
@@ -3,21 +3,21 @@ import { SignalsServiceDefinition } from '@wix/services-definitions/core-service
|
|
|
3
3
|
import { SiteInfoDefinition } from '../definition';
|
|
4
4
|
export const SiteInfoService = implementService(SiteInfoDefinition, ({ config, getService }) => {
|
|
5
5
|
const { signal } = getService(SignalsServiceDefinition);
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const _name = signal(config.name);
|
|
7
|
+
const _revision = signal(config.revision);
|
|
8
8
|
return {
|
|
9
|
-
get
|
|
10
|
-
return
|
|
9
|
+
get name() {
|
|
10
|
+
return _name.get();
|
|
11
11
|
},
|
|
12
|
-
get
|
|
13
|
-
return
|
|
12
|
+
get revision() {
|
|
13
|
+
return _revision.get();
|
|
14
14
|
},
|
|
15
15
|
_updateConfig(update) {
|
|
16
|
-
if (typeof update.
|
|
17
|
-
|
|
16
|
+
if (typeof update.name !== 'undefined') {
|
|
17
|
+
_name.set(update.name);
|
|
18
18
|
}
|
|
19
|
-
if (typeof update.
|
|
20
|
-
|
|
19
|
+
if (typeof update.revision !== 'undefined') {
|
|
20
|
+
_revision.set(update.revision);
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteInfoService.js","sourceRoot":"","sources":["../../src/implementations/siteInfoService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAC9C,kBAAkB,EAClB,CAAC,EAAE,MAAM,EAAE,UAAU,EAA8C,EAAoB,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAA;IACvD,MAAM,
|
|
1
|
+
{"version":3,"file":"siteInfoService.js","sourceRoot":"","sources":["../../src/implementations/siteInfoService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAC9C,kBAAkB,EAClB,CAAC,EAAE,MAAM,EAAE,UAAU,EAA8C,EAAoB,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAA;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAEzC,OAAO;QACN,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,GAAG,EAAE,CAAA;QACnB,CAAC;QACD,IAAI,QAAQ;YACX,OAAO,SAAS,CAAC,GAAG,EAAE,CAAA;QACvB,CAAC;QACD,aAAa,CAAC,MAAuC;YACpD,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBACxC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACvB,CAAC;YACD,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;gBAC5C,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC/B,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-service-site-info",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
"falconPackageHash": "
|
|
80
|
+
"falconPackageHash": "9ca22f2f212b83bd0b77df5bf34004090d28fb13ab1342b33e2b7bdc"
|
|
81
81
|
}
|
package/src/definition/index.ts
CHANGED
|
@@ -8,37 +8,51 @@ export type ISiteInfoServiceConfig = {
|
|
|
8
8
|
*
|
|
9
9
|
* @exampleValue 'My Bakery'
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
name: string
|
|
12
12
|
/**
|
|
13
13
|
* Revision of the site that is being rendered. `0` when the host has no revision.
|
|
14
14
|
*
|
|
15
15
|
* @exampleValue 42
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
revision: number
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/** Reports the display name and revision number of the site your code runs on. */
|
|
21
21
|
export interface ISiteInfoService {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Site's display name.
|
|
24
|
+
*
|
|
25
|
+
* A Wix user sets it in the Website Settings section of the site's dashboard.
|
|
26
|
+
*
|
|
27
|
+
* This value can change while the page is open. It changes when a Wix user renames the site while
|
|
28
|
+
* editing it. Read it while a component renders, or inside an `effect` or `computed`, to react to
|
|
29
|
+
* changes.
|
|
24
30
|
*
|
|
25
31
|
* `''` when the site has no display name.
|
|
26
32
|
*
|
|
27
|
-
* @exampleValue '
|
|
33
|
+
* @exampleValue 'Example Outfitters'
|
|
28
34
|
*/
|
|
29
|
-
readonly
|
|
35
|
+
readonly name: string
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
37
|
+
* Site's revision number.
|
|
38
|
+
*
|
|
39
|
+
* The site gets a new revision each time a Wix user saves or publishes it after a change.
|
|
40
|
+
*
|
|
41
|
+
* This value can change while the page is open. It changes when the site gets a new revision while a
|
|
42
|
+
* Wix user is editing it. Read it while a component renders, or inside an `effect` or `computed`, to
|
|
43
|
+
* react to changes.
|
|
32
44
|
*
|
|
33
|
-
* `0` when
|
|
45
|
+
* `0` when no revision is available.
|
|
34
46
|
*
|
|
35
47
|
* @exampleValue 42
|
|
36
48
|
*/
|
|
37
|
-
readonly
|
|
38
|
-
/**
|
|
49
|
+
readonly revision: number
|
|
50
|
+
/** @internal Host-only. Replaces config values when the host's state changes. */
|
|
39
51
|
_updateConfig: (config: Partial<ISiteInfoServiceConfig>) => void
|
|
40
52
|
}
|
|
41
53
|
|
|
54
|
+
/** Definition of the Site Info service, used to resolve it from the services manager. */
|
|
42
55
|
export type ISiteInfoDefinition = ServiceDefinition<ISiteInfoService, ISiteInfoServiceConfig>
|
|
43
56
|
|
|
57
|
+
/** Definition of the Site Info service. Specify it in `useService()` or `servicesManager.getService()`. */
|
|
44
58
|
export const SiteInfoDefinition = defineService<ISiteInfoService, ISiteInfoServiceConfig>('@wix/site-service-site-info')
|
|
@@ -8,22 +8,22 @@ export const SiteInfoService = implementService(
|
|
|
8
8
|
SiteInfoDefinition,
|
|
9
9
|
({ config, getService }: ServiceFactoryOpts<ISiteInfoServiceConfig>): ISiteInfoService => {
|
|
10
10
|
const { signal } = getService(SignalsServiceDefinition)
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const _name = signal(config.name)
|
|
12
|
+
const _revision = signal(config.revision)
|
|
13
13
|
|
|
14
14
|
return {
|
|
15
|
-
get
|
|
16
|
-
return
|
|
15
|
+
get name() {
|
|
16
|
+
return _name.get()
|
|
17
17
|
},
|
|
18
|
-
get
|
|
19
|
-
return
|
|
18
|
+
get revision() {
|
|
19
|
+
return _revision.get()
|
|
20
20
|
},
|
|
21
21
|
_updateConfig(update: Partial<ISiteInfoServiceConfig>) {
|
|
22
|
-
if (typeof update.
|
|
23
|
-
|
|
22
|
+
if (typeof update.name !== 'undefined') {
|
|
23
|
+
_name.set(update.name)
|
|
24
24
|
}
|
|
25
|
-
if (typeof update.
|
|
26
|
-
|
|
25
|
+
if (typeof update.revision !== 'undefined') {
|
|
26
|
+
_revision.set(update.revision)
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
}
|