diff --git a/docs/change-log.md b/docs/change-log.md index d0de73bc..f68c9f77 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -28,6 +28,7 @@ If you are migrating, consider using the [mithril-codemods](https://www.npmjs.co - [`m.route` and anchor tags](#mroute-and-anchor-tags) - [Reading/writing the current route](#readingwriting-the-current-route) - [Accessing route params](#accessing-route-params) +- [Building/Parsing query strings](#buildingparsing-query-strings) - [Preventing unmounting](#preventing-unmounting) - [Run code on component removal](#run-code-on-component-removal) - [`m.request`](#mrequest) @@ -459,6 +460,28 @@ m.route(document.body, "/booga", { --- +## Building/Parsing query strings + +`v0.2.x` used methods hanging off of `m.route`, `m.route.buildQueryString()` and `m.route.parseQueryString()`. In `v1.x` these have been broken out and attached to the root `m`. + +### `v0.2.x` + +```javascript +var qs = m.route.buildQueryString({ a : 1 }); + +var obj = m.route.parseQueryString("a=1"); +``` + +### `v1.x` + +```javascript +var qs = m.buildQueryString({ a : 1 }); + +var obj = m.parseQueryString("a=1"); +``` + +--- + ## Preventing unmounting It is no longer possible to prevent unmounting via `onunload`'s `e.preventDefault()`. Instead you should explicitly call `m.route.set` when the expected conditions are met.