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

Preserve query parameters when rebasing location path #67

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ modules

coverage
lib
/package-lock.json
2 changes: 1 addition & 1 deletion address.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define(function(require) {
, error = require('./error')
, dispatch = require('d3-dispatch').dispatch
, rebind = require('./rebind')
, location = require('./location')
, location = require('./location')()
, middleware = require('./middleware')

function address(r) {
Expand Down
2 changes: 1 addition & 1 deletion bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define(function(require) {
, httpStatusCode: require('./http-status-code')
, interpolate: require('./interpolate')
, into: require('./into')
, location: require('./location')
, location: require('./location')()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location module is effectively a singleton prior to these changes. I can understand how this makes testing more difficult, however it seems to me that by changing this to be an instantiated module with local state, this also breaks the API. Anything now depending on address.location can no longer rely on the state of this module to be the same as what's used by address internally. At least, that's how I read this – it's a bit difficult to follow the changes.

, middleware: require('./middleware')
, ok: require('./ok')
, redirect: require('./redirect')
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Karma configuration
// Generated on Thu Sep 26 2013 10:51:28 GMT+0100 (GMT Daylight Time)
process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function(config) {
config.set({
Expand All @@ -9,7 +9,7 @@ module.exports = function(config) {


// frameworks to use
frameworks: ['requirejs', 'mocha', 'sinon-chai'],
frameworks: ['requirejs', 'mocha', 'chai-sinon'],


// list of files / patterns to load in the browser
Expand Down
Loading