From 4b40d2d3b57ca6bc64180c25d889e7bd8cc773c3 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Wed, 26 Oct 2016 11:17:16 -0400 Subject: [PATCH] links --- README.md | 2 +- docs/redraw.md | 24 ++++++++++++++++++++++++ docs/version.md | 27 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 docs/redraw.md create mode 100644 docs/version.md diff --git a/README.md b/README.md index 0ac3259c..d261b30f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mithril.js - A framework for building brilliant applications -[Documentation](docs) | [Migration Guide](docs/v1.x-migration.md) +[Installation](docs/installation.md) | [API](docs/api.md) | [Migration Guide](docs/v1.x-migration.md) Note: This branch is a sneak peek for the upcoming version 1.0. It's a rewrite from the ground up and it's not backwards compatible with [Mithril 0.2.x](http://mithril.js.org). You can find preliminary [documentation here](docs) and [migration guide here](docs/v1.x-migration.md) diff --git a/docs/redraw.md b/docs/redraw.md new file mode 100644 index 00000000..fa80a5a4 --- /dev/null +++ b/docs/redraw.md @@ -0,0 +1,24 @@ +# redraw() + +- [API](#api) +- [How it works](#how-it-works) + +--- + +### API + +`m.redraw()` + +Argument | Type | Required | Description +----------- | -------------------- | -------- | --- +**returns** | | | Returns nothing + +--- + +### How it works + +When callbacks outside of Mithril run, you need to notify Mithril's rendering engine that a redraw is needed. External callbacks could be `setTimeout`/`setInterval`/`requestAnimationFrame` callbacks, web socket library callbacks, event handlers in jQuery plugins, third party XHR request callbacks, etc. + +To trigger a redraw, call `m.redraw()` + +You should not call m.redraw from a [lifecycle method](lifecycle-methods.md). Doing so will result in undefined behavior. \ No newline at end of file diff --git a/docs/version.md b/docs/version.md new file mode 100644 index 00000000..5cc6f219 --- /dev/null +++ b/docs/version.md @@ -0,0 +1,27 @@ +# version + +- [API](#api) +- [How it works](#how-it-works) + +--- + +### API + +`m.version` + +Argument | Type | Required | Description +----------- | -------------------- | -------- | --- +**returns** | String | | Returns the version number + +--- + +### How it works + +The `m.version` property is a string containing the [semver](http://semver.org/) value for the current release. + +Semver (or Semantic Versioning) specifies that a version number must follow the syntax "0.0.0", where the first number is the MAJOR number, the second is the MINOR number and the third is the PATCH number. + +- The MAJOR number changes when there are backwards-incompatible API changes, +- The MINOR number changes when functionality is added in a backwards-compatible manner, and +- The PATCH number changes when there are backwards-compatible bug fixes +