Skip to content

Commit

Permalink
Update docs, bump version, update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed Mar 1, 2015
1 parent e6e8477 commit 42f5b0a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.10.10

* Allow `create` to use a `$ref` to a factory function, as well as args to create components.

### 0.10.9

* Allow arbitrarily deep dot traversal in `$ref`s.
Expand Down Expand Up @@ -199,4 +203,4 @@ myTemplate: {
* pubsub connector, subscribe *and publish* non-invasively using `dojo.publish/subscribe`
* event connector that uses dojo.connect
* easy JsonRest datastores via `resource!` reference resolver
* `dom.query!` reference resolver that uses `dojo.query`
* `dom.query!` reference resolver that uses `dojo.query`
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wire",
"version": "0.10.9",
"version": "0.10.10",
"main": "./wire.js",
"dependencies": {
"meld": "~1",
Expand Down
29 changes: 29 additions & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,24 @@ myComponent: {
}
```

The create factory can also accept a reference to a function, constructor, or object to use to create the new component.

```js
factory: {
module: 'my/app/ModuleA'
},
myComponent: {
create: {
// Call factory as a constructor or function
// factory can be any component that is a function,
// constructor, or object.
module: { $ref: 'factory' }
args: [arg1, arg2, arg3...]
}
}
```


### Short Syntax
```javascript
// This shorter syntax loads my/app/ModuleA and calls it with no args
Expand All @@ -178,6 +196,17 @@ myComponent: {
}
```

```javascript
// The shorter syntax can use a reference as well
factory: {
module: 'my/app/ModuleA'
},
myComponent: {
create: { $ref: 'factory' }
}
```


### isConstructor option notes

The create factory uses a set of simple heuristics to determine automatically whether to call the module as a constructor using `new`, or as a regular function.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wire",
"version": "0.10.9",
"version": "0.10.10",
"description": "A light, fast, flexible Javascript IOC container.",
"keywords": [
"ioc",
Expand Down Expand Up @@ -54,4 +54,4 @@
"test": "buster-test -e node",
"prepublish": "bower install"
}
}
}
6 changes: 3 additions & 3 deletions wire.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
*
* @author Brian Cavalier
* @author John Hann
* @version 0.10.9
* @version 0.10.10
*/
(function(rootSpec, define){ 'use strict';
define(function(require) {

var createContext, rootContext, rootOptions;

wire.version = '0.10.9';
wire.version = '0.10.10';

createContext = require('./lib/context');

Expand Down Expand Up @@ -96,4 +96,4 @@ define(function(require) {
this['wire'] || {},
typeof define == 'function' && define.amd
? define : function(factory) { module.exports = factory(require); }
);
);

0 comments on commit 42f5b0a

Please sign in to comment.