Skip to content

Commit 7981d2a

Browse files
committed
Unprivate properties and methods
1 parent 4f4a2d1 commit 7981d2a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/base-element.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class BaseElement {
99
reference;
1010
mountedCallback;
1111
createdCallback;
12-
#inputTypes = ['text', 'search', 'url', 'number', 'password', 'email', 'tel'];
12+
inputTypes = ['text', 'search', 'url', 'number', 'password', 'email', 'tel'];
1313

1414
constructor(element) {
1515
this.element = element;
@@ -55,7 +55,7 @@ export class BaseElement {
5555

5656
isTextInput() {
5757
const tagname = this.tag();
58-
return ((tagname === 'input' && this.#inputTypes.includes(this.element.type)) || tagname === 'textarea');
58+
return ((tagname === 'input' && this.inputTypes.includes(this.element.type)) || tagname === 'textarea');
5959
}
6060

6161
created(callback) {

src/store.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ export function store(state) {
77
}
88

99
class Store {
10-
#callbacks;
11-
#state;
10+
callbacks;
11+
state;
1212

1313
constructor(state = null) {
14-
this.#state = state;
15-
this.#callbacks = [];
14+
this.state = state;
15+
this.callbacks = [];
1616
}
1717

1818
update(callback) {
19-
this.#state = callback(this.#state);
20-
this.#react();
19+
this.state = callback(this.state);
20+
this.react();
2121
}
2222

2323
get() {
24-
return this.#state;
24+
return this.state;
2525
}
2626

2727
set(state) {
28-
this.#state = state;
29-
this.#react();
28+
this.state = state;
29+
this.react();
3030
}
3131

32-
#react() {
32+
react() {
3333
const self = this;
34-
this.#callbacks.forEach(callback => callback(self.#state));
34+
this.callbacks.forEach(callback => callback(self.state));
3535
}
3636

3737
model(callback) {
38-
this.#callbacks.push(callback);
39-
callback(this.#state);
38+
this.callbacks.push(callback);
39+
callback(this.state);
4040
}
4141
}

0 commit comments

Comments
 (0)