mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-29 10:20:09 +00:00
working on docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c667a92236
commit
32073f4ed9
18
README.md
18
README.md
@ -10,9 +10,13 @@ The Feature / Action couple is meta-programming library that helps with:
|
|||||||
Actions are an extension to the JavaScript object model tailored for
|
Actions are an extension to the JavaScript object model tailored for
|
||||||
a set of specific tasks.
|
a set of specific tasks.
|
||||||
|
|
||||||
By design this tool-set promotes a _cooperative_ model and makes it
|
To distinguish this from the native JavaScript elements we introduce new
|
||||||
hard to change/modify existing signatures / _contracts_ in _extending_
|
terminology, an _action_ is an extended _method_ while an _action set_ is
|
||||||
code.
|
a _mixin object_ (stateless, including only functionality) both usable
|
||||||
|
stand-alone as well as _mixed_ into other objects.
|
||||||
|
|
||||||
|
Here is a trivial use-case to illustrate the motivation for this tool set:
|
||||||
|
|
||||||
|
|
||||||
#### The problem:
|
#### The problem:
|
||||||
|
|
||||||
@ -64,6 +68,7 @@ abstract this...
|
|||||||
|
|
||||||
#### The solution:
|
#### The solution:
|
||||||
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var N = Actions({
|
var N = Actions({
|
||||||
times: [function(n){
|
times: [function(n){
|
||||||
@ -104,8 +109,6 @@ n
|
|||||||
- _and more... (see below)_
|
- _and more... (see below)_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### What we get:
|
### What we get:
|
||||||
- **Call parent (_extended_) actions automatically**
|
- **Call parent (_extended_) actions automatically**
|
||||||
All actions (methods) in a chain are guaranteed to get called if the
|
All actions (methods) in a chain are guaranteed to get called if the
|
||||||
@ -146,6 +149,11 @@ n
|
|||||||
_(this is not final)_
|
_(this is not final)_
|
||||||
|
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
- By design this tool-set promotes a _cooperative_ model and makes it
|
||||||
|
hard to change/modify existing signatures / _contracts_ in _extending_
|
||||||
|
code, hence the restrictions.
|
||||||
|
|
||||||
|
|
||||||
### The main entities:
|
### The main entities:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user