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

Avoid global state #14

Closed
denis-sokolov opened this issue Jun 1, 2015 · 1 comment · Fixed by #18
Closed

Avoid global state #14

denis-sokolov opened this issue Jun 1, 2015 · 1 comment · Fixed by #18

Comments

@denis-sokolov
Copy link
Contributor

Is there any reason why docuri has to store everything in the global state risking conflicts between different parts of the application? Consider the alternative API with no global state:

var route = docuri.route('/foo/:bar/');

If the user wishes to store his routes in a global map, he is still free to do so, but he doesn't need to.
This addition is even backwards compatible, if we inspect the absence of name parameter.
I would, however, also recommend to promote this as the primary way to use the library.

@jo
Copy link
Owner

jo commented Jun 1, 2015

+1

denis-sokolov added a commit to Useclark/docuri that referenced this issue Jun 3, 2015
This breaks backwards compatibility.

This removes .routes because it's not intuitive what the result value
of that must be, and users are free to .map over .route themselves.

Also, .routes was never tested.

Fixes jo#14.
@jo jo closed this as completed in #18 Jun 3, 2015
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