mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-29 02:10:09 +00:00
working on docs..
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0df03cab41
commit
afd6eaf7a9
21
README.md
21
README.md
@ -72,7 +72,7 @@ Root Action o---|---x
|
||||
|
||||
### The action system main protocols:
|
||||
|
||||
1) Documentation generation and introspection (MetaActions)
|
||||
1. Documentation generation and introspection (MetaActions)
|
||||
|
||||
```
|
||||
<action>.toString()
|
||||
@ -93,7 +93,7 @@ Root Action o---|---x
|
||||
```
|
||||
|
||||
|
||||
2) Event-like callbacks for actions (MetaActions, Action)
|
||||
2. Event-like callbacks for actions (MetaActions, Action)
|
||||
|
||||
```
|
||||
<action-set>.on('action', function(){ ... })
|
||||
@ -103,7 +103,7 @@ Root Action o---|---x
|
||||
```
|
||||
|
||||
|
||||
3) A mechanism to define and extend already defined actions
|
||||
3. A mechanism to define and extend already defined actions
|
||||
This replaces / complements the standard JavaScript overloading
|
||||
mechanisms (Action, Actions)
|
||||
|
||||
@ -122,7 +122,7 @@ var O = Actions(X, {
|
||||
})
|
||||
```
|
||||
|
||||
NOTE: what is done here is similar to calling O.__proto__.m.call(..)
|
||||
NOTE: what is done here is similar to calling `O.__proto__.m.call(..)`
|
||||
but is implicit, and not dependant on the original containing
|
||||
object name/reference ('O'), thus enabling an action to be
|
||||
referenced and called from any object and still chain correctly.
|
||||
@ -131,7 +131,7 @@ var O = Actions(X, {
|
||||
|
||||
### Secondary action protocols:
|
||||
|
||||
1) A mechanism to manually call the pre/post stages of an action
|
||||
1. A mechanism to manually call the pre/post stages of an action
|
||||
|
||||
Pre phase...
|
||||
```
|
||||
@ -156,7 +156,7 @@ NOTE: there is not reliable way to call the post phase without first
|
||||
pre phase functions can return post phase functions).
|
||||
|
||||
|
||||
2) A mechanism to chain/wrap actions or an action and a function.
|
||||
2. A mechanism to chain/wrap actions or an action and a function.
|
||||
This enables us to call a callback or another action (inner) between
|
||||
the root action's (outer) pre and post stages.
|
||||
|
||||
@ -202,9 +202,9 @@ implementationAction2: [function(){
|
||||
|
||||
Now calling any of the 'implementation' actions will execute code
|
||||
in the following order:
|
||||
1) pre phase of protocol action (outer)
|
||||
2) implementation action (inner)
|
||||
3) post phase of protocol action (outer)
|
||||
1. pre phase of protocol action (outer)
|
||||
2. implementation action (inner)
|
||||
3. post phase of protocol action (outer)
|
||||
|
||||
NOTE: this will not affect to protocol/signature of the outer action
|
||||
in any way.
|
||||
@ -217,7 +217,8 @@ NOTE: there is intentionally no shorthand for this feature, to avoid
|
||||
really necessary.
|
||||
|
||||
|
||||
3) `.__call__` action / handler
|
||||
3. `.__call__` action / handler
|
||||
|
||||
This action if defined is called for every action called. It behaves
|
||||
like any other action but with a fixed signature, it always receives
|
||||
the action name as first argument and a list of action arguments as
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user