From c16b636a40236587dfd7e222102fb0b04fbf6224 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Thu, 24 May 2012 21:57:50 +0100 Subject: [PATCH] [doc,view][xs]: mention flash messages / notifications. --- src/view.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/view.js b/src/view.js index 3731de62..4324994e 100644 --- a/src/view.js +++ b/src/view.js @@ -71,6 +71,21 @@ // State is available not only for individual views (as described above) but // for the dataset (e.g. the current query). For an example of pulling together // state from across multiple components see `recline.View.DataExplorer`. +// +// ### Flash Messages / Notifications +// +// To send 'flash messages' or notifications the convention is that views +// should fire an event named `recline:flash` with a payload that is a +// flash object with the following attributes (all optional): +// +// * message: message to show. +// * category: warning (default), success, error +// * persist: if true alert is persistent, o/w hidden after 3s (default=false) +// * loader: if true show a loading message +// +// Objects or views wishing to bind to flash messages may then subscribe to +// these events and take some action such as displaying them to the user. For +// an example of such behaviour see the DataExplorer view. // // ### Writing your own Views //