Skip to content

Commit 00e08f1

Browse files
committed
Minor tweaks
1 parent 6c2c87f commit 00e08f1

7 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎.vscode/settings.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"Goede",
44
"Protos",
55
"asynchronicity",
6+
"behaviour",
67
"campbells",
78
"firstname",
89
"instanceof",

‎src/week3/7-oop/nobel-prize-classes/Observer.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
class Observer {
55
constructor(subject) {
6-
subject.register(this);
6+
subject.subscribe(this);
77
}
88
}
99

‎src/week3/7-oop/nobel-prize-classes/Subject.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
this.observers = new Set();
77
}
88

9-
register(observer = {}) {
9+
subscribe(observer = {}) {
1010
if (!(typeof observer.update === 'function')) {
1111
throw new Error(`Observer must implement an 'update' method.`);
1212
}

‎src/week3/7-oop/nobel-prize-prototype/Observer.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
function Observer(subject) {
5-
subject.register(this);
5+
subject.subscribe(this);
66
}
77

88
window.Observer = Observer;

‎src/week3/7-oop/nobel-prize-prototype/Subject.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
this.observers = new Set();
66
}
77

8-
Subject.prototype.register = function(observer = {}) {
8+
Subject.prototype.subscribe = function(observer = {}) {
99
if (!(typeof observer.update === 'function')) {
1010
throw new Error(`Observer must implement an 'update' method.`);
1111
}

‎src/week3/7-oop/nobel-prize-simple/Model.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
};
1515
}
1616

17-
register(view) {
17+
subscribe(view) {
1818
this.views.push(view);
1919
}
2020

‎src/week3/7-oop/nobel-prize-simple/View.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
class View {
77
constructor(model) {
8-
model.register(this);
8+
model.subscribe(this);
99
this.root = document.getElementById('root');
1010
model.fetchData();
1111
}

0 commit comments

Comments
 (0)