From 05c411e7ba9a8a65cc5f133df04fc8e0ab059447 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 23 Aug 2016 18:59:19 +0300 Subject: [PATCH] working on docs.. Signed-off-by: Alex A. Naanou --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index d4e9db6..20eb2d3 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,46 @@ code. ### The main entities: +```javascript +// Action set... +var Base = Actions({ + get value(){ + return this.__value || 0 + }, + set value(val){ + this.__value = val + }, + + print: [function(){ + console.log(this.value) + }], + + times: ['get value', + function(n){ + this.value *= n + + return this.value + }], +}) + + +var Extending = Actions(Base, { + times: [function(n){ + console.log(this.value, 'times', n, 'is:') + + return function(result, n){ + console.log(' ', this.value) + } + }] +}) + + +``` + **Action set** + + + - an object containing a number of actions, - optionally, directly or indirectly inherited from `MetaActions` and/or other action sets,