javascript-react-patterns icon indicating copy to clipboard operation
javascript-react-patterns copied to clipboard

There are some typos and the fullName method doesn't exist in the User class

Open nickjeon opened this issue 2 years ago • 1 comments

There are some typos in https://github.com/lydiahallie/javascript-react-patterns/blob/main/pages/patterns/design-patterns/factory-pattern.mdx

The fullName method is the same for all the objects that were created. By creating new instances, the fullName method is available on the prototype instead of on the objec, which saves memory.

It should be ... on the prototype instead of on the object....

In this section, the fullName method doesn't exist in the User class. There is the getPosts method instead.

https://javascriptpatterns.vercel.app/patterns/design-patterns/factory-pattern#tradeoffs

nickjeon avatar Oct 07 '22 01:10 nickjeon

I think this issue is fix by this PR!

oreo2990 avatar Oct 12 '22 11:10 oreo2990