Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory create duplicates in react-typescript exemple #10

Open
clementoriol opened this issue Dec 24, 2020 · 3 comments · May be fixed by #11
Open

Factory create duplicates in react-typescript exemple #10

clementoriol opened this issue Dec 24, 2020 · 3 comments · May be fixed by #11

Comments

@clementoriol
Copy link

Hi,
I was looking around in the example files to get a better understanding on how to get type-safe factories, and realized that the factory in the react-typescript always creates the same object.

I was expecting :

server.createList("person", 20);

to create 20 unique Person objects, but it creates 20 identical ones.

Is this expected ?
Modifying the factory to use regular functions instead of getters works, but I'm a bit confused about how to type it properly.

@GregBelle
Copy link

I have the same issue. I'm ha ving some trouble figuring out how to modify it to show different people.

@clementoriol
Copy link
Author

Hey @GregBelle ,
found a way to fix it, you can check what I did on my PR: #11

@GregBelle
Copy link

@clementoriol Thanks! I copied in your updates locally and was able to follow the pattern for my own factory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants