Skip to content

Commit b618b89

Browse files
authored
Merge pull request #11 from Psidium/patch-1
factoryMethod: add a more TypeScript-y Factory fn
2 parents 9c653ca + 771ad9a commit b618b89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

factory_method/factoryMethod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace FactoryMethodPattern {
1717
}
1818

1919

20-
export class ProductFactory {
21-
public static createProduct(type: string) : AbstractProduct {
20+
export namespace ProductFactory {
21+
export function createProduct(type: string) : AbstractProduct {
2222
if (type === "A") {
2323
return new ConcreteProductA();
2424
} else if (type === "B") {

0 commit comments

Comments
 (0)