Skip to content

Commit aae421b

Browse files
committed
Incorrect pattern name fixed
1 parent 742f4e1 commit aae421b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/data/patterns.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,34 +133,34 @@ export default RequestPattern;`
133133
{
134134
name: 'Factory',
135135
type: 'creational',
136-
codeES5: `function bmwPattern(type) {
137-
if (type === 'X5') return new Bmw(type, 108000, 300);
138-
if (type === 'X6') return new Bmw(type, 111000, 320);
136+
codeES5: `function teslaPattern(type) {
137+
if (type === 'ModelX') return new Tesla(type, 108000, 300);
138+
if (type === 'ModelS') return new Tesla(type, 111000, 320);
139139
}
140140
141-
function Bmw(model, price, maxSpeed) {
141+
function Tesla(model, price, maxSpeed) {
142142
this.model = model;
143143
this.price = price;
144144
this.maxSpeed = maxSpeed;
145145
}
146146
147-
module.exports = bmwPattern;`,
148-
codeES6: `class BmwPattern {
147+
module.exports = teslaPattern;`,
148+
codeES6: `class TeslaPattern {
149149
create(type) {
150-
if (type === 'X5') return new Bmw(type, 108000, 300);
151-
if (type === 'X6') return new Bmw(type, 111000, 320);
150+
if (type === 'ModelX') return new Tesla(type, 108000, 300);
151+
if (type === 'ModelS') return new Tesla(type, 111000, 320);
152152
}
153153
}
154154
155-
class Bmw {
155+
class Tesla {
156156
constructor(model, price, maxSpeed) {
157157
this.model = model;
158158
this.price = price;
159159
this.maxSpeed = maxSpeed;
160160
}
161161
}
162162
163-
export default BmwPattern;`
163+
export default TeslaPattern;`
164164
},
165165
/*
166166
* Prototype
@@ -1273,7 +1273,7 @@ export { Product, fees, proft };`
12731273
* State
12741274
*/
12751275
{
1276-
name: 'Pattern',
1276+
name: 'State',
12771277
type: 'behavioral',
12781278
codeES5: `function Order() {
12791279
this.pattern = new WaitingForPayment();

0 commit comments

Comments
 (0)