Skip to content

Commit 91c1655

Browse files
authored
Use property for public reactive properties (#993)
1 parent dd10217 commit 91c1655

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

frontend/src/static/js/components/webstatus-overview-content.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
nothing,
2424
} from 'lit';
2525
import {TaskStatus} from '@lit/task';
26-
import {customElement, state} from 'lit/decorators.js';
26+
import {customElement, property, state} from 'lit/decorators.js';
2727
import {type components} from 'webstatus.dev-backend';
2828

2929
import './webstatus-overview-filters.js';
@@ -45,14 +45,14 @@ const webFeaturesRepoUrl = 'https://github.com/web-platform-dx/web-features';
4545

4646
@customElement('webstatus-overview-content')
4747
export class WebstatusOverviewContent extends LitElement {
48-
@state()
48+
@property({type: Object})
4949
taskTracker: TaskTracker<components['schemas']['FeaturePage'], ApiError> = {
5050
status: TaskStatus.INITIAL, // Initial state
5151
error: null,
5252
data: null,
5353
};
5454

55-
@state()
55+
@property({type: Object})
5656
location!: {search: string}; // Set by parent.
5757

5858
@consume({context: webFeatureProgressContext, subscribe: true})

frontend/src/static/js/components/webstatus-overview-pagination.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
html,
2323
nothing,
2424
} from 'lit';
25-
import {customElement, state} from 'lit/decorators.js';
25+
import {customElement, state, property} from 'lit/decorators.js';
2626
import {ifDefined} from 'lit/directives/if-defined.js';
2727
import {range} from 'lit/directives/range.js';
2828
import {map} from 'lit/directives/map.js';
@@ -37,7 +37,7 @@ import {SHARED_STYLES} from '../css/shared-css.js';
3737

3838
@customElement('webstatus-overview-pagination')
3939
export class WebstatusOverviewPagination extends LitElement {
40-
@state()
40+
@property({type: Number})
4141
totalCount: number | undefined = undefined;
4242

4343
@state()
@@ -46,7 +46,7 @@ export class WebstatusOverviewPagination extends LitElement {
4646
@state()
4747
pageSize = DEFAULT_ITEMS_PER_PAGE; // Number of items to display per page
4848

49-
@state()
49+
@property({type: Object})
5050
location!: {search: string}; // Set by parent.
5151

5252
static get styles(): CSSResultGroup {

frontend/src/static/js/components/webstatus-overview-table.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {LitElement, type TemplateResult, html, CSSResultGroup, css} from 'lit';
1717
import {TaskStatus} from '@lit/task';
1818
import {range} from 'lit/directives/range.js';
1919
import {map} from 'lit/directives/map.js';
20-
import {customElement, property, state} from 'lit/decorators.js';
20+
import {customElement, property} from 'lit/decorators.js';
2121
import {SHARED_STYLES} from '../css/shared-css.js';
2222
import {type components} from 'webstatus.dev-backend';
2323
import {getColumnsSpec, getSortSpec} from '../utils/urls.js';
@@ -39,14 +39,14 @@ import {Toast} from '../utils/toast.js';
3939

4040
@customElement('webstatus-overview-table')
4141
export class WebstatusOverviewTable extends LitElement {
42-
@state()
42+
@property({type: Object})
4343
taskTracker: TaskTracker<components['schemas']['FeaturePage'], ApiError> = {
4444
status: TaskStatus.INITIAL, // Initial state
4545
error: null,
4646
data: null,
4747
};
4848

49-
@state()
49+
@property({type: Object})
5050
location!: {search: string}; // Set by parent.
5151

5252
@property({type: Object})

0 commit comments

Comments
 (0)