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

Add limited random latency feature #16

Closed
wants to merge 3 commits into from

Conversation

asyncanup
Copy link

Really needed the feature to simulate real-world latency, so here it is :)

Usage:

$.mockJSON('/mock-request', template, 1500);

Now this request will return some time between 0 and 1500 ms.

Second, allowed arrays to be entered in template without a compulsory vertical bar "|", so that static arrays can be a part of the template.

Additionally, moved the sections of code around a bit for better comprehension and JSHint compliance, but that's a matter of style, so I would just move it back if you say so :)

@asyncanup
Copy link
Author

I would be willing to write some tests as well, if you think that's helpful..
I've been using this library for quite a while now, it's awesome :)

@asyncanup
Copy link
Author

Would fix #4 as well

@asyncanup asyncanup closed this Mar 10, 2017
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 this pull request may close these issues.

1 participant