thoughtbot / fishery

A library for setting up JavaScript objects as test data
MIT License
876 stars 36 forks source link

How to use rewind sequence #111

Closed Meeteyes closed 1 year ago

Meeteyes commented 1 year ago

Hello, could you please update the readme with an example how to use the rewindSequence()? In my usecase I would need the sequence rewinded after the factory is built, so the next call starts it from beginning.

stevehanson commented 1 year ago

Hello. There is some information in the readme about this, here. You can rewind the sequence anytime like this:

factory.build()
factory.rewindSequence()
factory.build() // sequence reset back to initial value

Let me know if you still have any questions.

stevehanson commented 1 year ago

Closing issue since a suggestion has been provided, and there has been no recent activity.