Skip to content

Commit

Permalink
Merge pull request torokmark#11 from Psidium/patch-1
Browse files Browse the repository at this point in the history
factoryMethod: add a more TypeScript-y Factory fn
  • Loading branch information
torokmark authored Apr 2, 2018
2 parents 9c653ca + 771ad9a commit b618b89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions factory_method/factoryMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace FactoryMethodPattern {
}


export class ProductFactory {
public static createProduct(type: string) : AbstractProduct {
export namespace ProductFactory {
export function createProduct(type: string) : AbstractProduct {
if (type === "A") {
return new ConcreteProductA();
} else if (type === "B") {
Expand Down

0 comments on commit b618b89

Please sign in to comment.