diff --git a/docs/change-log.md b/docs/change-log.md index e25932bb..beec9e40 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -29,6 +29,7 @@ If you are migrating, consider using the [mithril-codemods](https://www.npmjs.co - [Reading/writing the current route](#readingwriting-the-current-route) - [Accessing route params](#accessing-route-params) - [Preventing unmounting](#preventing-unmounting) +- [Run code on component removal](#run-code-on-component-removal) - [`m.request`](#mrequest) - [`m.deferred` removed](#mdeferred-removed) - [`m.sync` removed](#msync-removed) @@ -489,6 +490,40 @@ var Component = { --- +## Run code on component removal + +Components no longer call `this.onunload` when they are being removed. They now use the standardized lifecycle hook `onremove`. + +### `v0.2.x` + +```javascript +var Component = { + controller: function() { + this.onunload = function(e) { + // ... + } + }, + view: function() { + // ... + } +} +``` + +### `v1.x` + +```javascript +var Component = { + onremove : function() { + // ... + } + view: function() { + // ... + } +} +``` + +--- + ## m.request Promises returned by [m.request](request.md) are no longer `m.prop` getter-setters. In addition, `initialValue`, `unwrapSuccess` and `unwrapError` are no longer supported options.