laroute
laroute copied to clipboard
Method .route mutating params object
const params = { id: 1 }
Laroute.route(route, params)
console.log(params) // > {}
Hi, I've experienced a bug when by using route method and passing object with params to it, I get my object kinda destroyed. This issue is occurs in the replaceNamedParameters()
I believe.
@aaronlord
Yeah, apparently Laroute is deleting all the matching variables from the param array. This is for using some variables as params, if they match, and all the other variables as query string.
Therefore something like:
const params = { id: 1 };
Laroute.route(route1, params);
Laroute.route(route2, params);
Will not work.
I think that Laroute should make a copy of the passed parameters and use them.
Yeah, this is a bug.