mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 18:40:08 +00:00
doc...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
deb68e8651
commit
9af75efc8f
30
README.md
30
README.md
@ -423,6 +423,8 @@ var myArray = object.Constructor('myArray', Array, {
|
|||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
|
### `sources(..)`
|
||||||
|
|
||||||
Get sources for attribute
|
Get sources for attribute
|
||||||
```
|
```
|
||||||
sources(<object>, <name>)
|
sources(<object>, <name>)
|
||||||
@ -431,6 +433,8 @@ sources(<object>, <name>, <callback>)
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `parent(..)`
|
||||||
|
|
||||||
Get parent attribute value or method
|
Get parent attribute value or method
|
||||||
```
|
```
|
||||||
parent(<prototype>, <name>)
|
parent(<prototype>, <name>)
|
||||||
@ -448,6 +452,9 @@ to the same method under the same name, `parent(..)` can't distinguish
|
|||||||
between these references and will always return the second one._
|
between these references and will always return the second one._
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### `parentProperty(..)`
|
||||||
|
|
||||||
Get parent property descriptor
|
Get parent property descriptor
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -457,6 +464,8 @@ parentProperty(<prototype>, <name>)
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `parentCall(..)`
|
||||||
|
|
||||||
Get parent method and call it
|
Get parent method and call it
|
||||||
```
|
```
|
||||||
parentCall(<prototype>, <name>, <this>)
|
parentCall(<prototype>, <name>, <this>)
|
||||||
@ -469,13 +478,26 @@ parentCall(<method>, <this>)
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `mixin(..)`
|
||||||
|
|
||||||
Mixin objects into a prototype chain
|
Mixin objects into a prototype chain
|
||||||
```
|
```
|
||||||
mixin(<root>, <object>, ..)
|
mixin(<root>, <object>, ..)
|
||||||
-> <object>
|
-> <root>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `mixout(..)`
|
||||||
|
|
||||||
|
Mix objects out of a prototype chain
|
||||||
|
```
|
||||||
|
mixout(<root>, <object>, ..)
|
||||||
|
-> <root>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `mixinFlat(..)`
|
||||||
|
|
||||||
Mixin contents of objects into one
|
Mixin contents of objects into one
|
||||||
```
|
```
|
||||||
mixinFlat(<root>, <object>, ..)
|
mixinFlat(<root>, <object>, ..)
|
||||||
@ -485,6 +507,8 @@ This is like `Object.assign(..)` but copies property objects rather than
|
|||||||
property values.
|
property values.
|
||||||
|
|
||||||
|
|
||||||
|
### `makeRawInstance(..)`
|
||||||
|
|
||||||
Make a raw (un-initialized) instance
|
Make a raw (un-initialized) instance
|
||||||
```
|
```
|
||||||
makeRawInstance(<context>, <constructor>, ..)
|
makeRawInstance(<context>, <constructor>, ..)
|
||||||
@ -505,6 +529,8 @@ makeRawInstance(<context>, <constructor>, ..)
|
|||||||
A shorthand to this is `Constructor.__rawinstance__(context, ..)`.
|
A shorthand to this is `Constructor.__rawinstance__(context, ..)`.
|
||||||
|
|
||||||
|
|
||||||
|
### `Constructor(..)`
|
||||||
|
|
||||||
Define an object constructor
|
Define an object constructor
|
||||||
```
|
```
|
||||||
Constructor(<name>)
|
Constructor(<name>)
|
||||||
@ -528,6 +554,8 @@ The resulting _constructor_ function when called will:
|
|||||||
- call instance's `.__init__(..)` if present.
|
- call instance's `.__init__(..)` if present.
|
||||||
|
|
||||||
|
|
||||||
|
### `C(..)`
|
||||||
|
|
||||||
Shorthand to `Constructor(..)`
|
Shorthand to `Constructor(..)`
|
||||||
```
|
```
|
||||||
C(<name>, ..)
|
C(<name>, ..)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user