Skip to content

Commit

Permalink
Improve registry api docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Aug 8, 2016
1 parent 9ee859b commit 78fb898
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions packages/trucks-compiler/README.md
Expand Up @@ -456,23 +456,23 @@ Returns string file contents.

### Registry

Registry for a mapping between protocol schemes and resolver classes.
Registry for a mapping between protocols and resolver classes.

#### Registry

```javascript
public Registry()
```

Create a new scheme registry.
Create a new protocol registry.

#### setDefault

```javascript
public setDefault(val)
```

Set the default scheme resolver.
Set the default protocol resolver.

* `val` Function resolver class.

Expand All @@ -482,7 +482,7 @@ Set the default scheme resolver.
public getDefault()
```

Get the default scheme resolver.
Get the default protocol resolver.

Will be `null` if no plugins have registered a default handler by calling
the `setDefault` method.
Expand All @@ -495,7 +495,7 @@ Returns a default resolver class.
public getResolver(scheme)
```

Get the resolver class for a given scheme.
Get the resolver class for a given protocol.

If the scheme is invalid (false) then a default scheme is returned, if no
default scheme has been registered the return value is `null`.
Expand All @@ -512,7 +512,7 @@ Returns a resolver class for the scheme.
public register(scheme, resolver)
```

Register a resolver class for a scheme.
Register a resolver class for a protocol.

Scheme names should include a trailing colon.

Expand All @@ -529,7 +529,7 @@ Create a new resolver for an `href`.

* `state` Object compiler state.
* `href` String the URL to resolve.
* `parent` Object a parent resolver instance.
* `parent` Object owner protocol resolver.

### ComponentTree < ComponentImport

Expand Down
14 changes: 7 additions & 7 deletions packages/trucks-compiler/src/registry.js
@@ -1,12 +1,12 @@
/**
* Registry for a mapping between protocol schemes and resolver classes.
* Registry for a mapping between protocols and resolver classes.
*
* @public {class} Registry
*/
class Registry {

/**
* Create a new scheme registry.
* Create a new protocol registry.
*
* @public {constructor} Registry
*/
Expand All @@ -17,7 +17,7 @@ class Registry {
}

/**
* Set the default scheme resolver.
* Set the default protocol resolver.
*
* @public {function} setDefault
* @param {Function} val resolver class.
Expand All @@ -27,7 +27,7 @@ class Registry {
}

/**
* Get the default scheme resolver.
* Get the default protocol resolver.
*
* Will be `null` if no plugins have registered a default handler by calling
* the `setDefault` method.
Expand All @@ -40,7 +40,7 @@ class Registry {
}

/**
* Get the resolver class for a given scheme.
* Get the resolver class for a given protocol.
*
* If the scheme is invalid (false) then a default scheme is returned, if no
* default scheme has been registered the return value is `null`.
Expand All @@ -60,7 +60,7 @@ class Registry {
}

/**
* Register a resolver class for a scheme.
* Register a resolver class for a protocol.
*
* Scheme names should include a trailing colon.
*
Expand All @@ -82,7 +82,7 @@ class Registry {
* @public {function} factory
* @param {Object} state compiler state.
* @param {String} href the URL to resolve.
* @param {Object} parent a parent resolver instance.
* @param {Object} parent owner protocol resolver.
*/
factory(state, href, parent) {
let Type
Expand Down

0 comments on commit 78fb898

Please sign in to comment.