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
fe41d7d94f
commit
75a142e32f
30
README.md
30
README.md
@ -150,6 +150,21 @@ Now:
|
|||||||
|
|
||||||
|
|
||||||
**Action set**
|
**Action set**
|
||||||
|
```javascript
|
||||||
|
var empty_full = new ActionSet()
|
||||||
|
|
||||||
|
var minimal = Actions({
|
||||||
|
// action and prop definitions...
|
||||||
|
})
|
||||||
|
|
||||||
|
var full = Actions(ActionSet(), {
|
||||||
|
// ...
|
||||||
|
})
|
||||||
|
|
||||||
|
var inherited = Actions(full, {
|
||||||
|
// ...
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
- an object containing a number of actions,
|
- an object containing a number of actions,
|
||||||
- optionally, directly or indirectly inherited from `MetaActions`
|
- optionally, directly or indirectly inherited from `MetaActions`
|
||||||
@ -222,6 +237,21 @@ Root Action o---|---x
|
|||||||
|
|
||||||
|
|
||||||
**Action (event) handler**
|
**Action (event) handler**
|
||||||
|
```javascript
|
||||||
|
action_set.on('action_name', function(){
|
||||||
|
// post code...
|
||||||
|
})
|
||||||
|
|
||||||
|
action_set.on('action_name.post', function(){
|
||||||
|
// post code...
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
action_set.on('action_name.pre', function(){
|
||||||
|
// pre code...
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
- a function,
|
- a function,
|
||||||
- can be bound to run before and/or after the action itself,
|
- can be bound to run before and/or after the action itself,
|
||||||
- is local to an action set it was bound via,
|
- is local to an action set it was bound via,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user