Skip to content

Commit

Permalink
Clarify that rootOf() goes all the way up the chain of spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
tguzik committed Nov 17, 2018
1 parent b60cc5c commit 84907ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ isSpace({}); // returns false
Parameter: A space
Returns: The the deepest root space associated with the given space.
Returns: The root space associated with the given space.
**Note**: Returns the latest root space of the passed in space. This means you can safely do `rootOf(space)` anywhere in a custom action, and always get the latest version.
**Note**: This function goes all the way up in the chain of parent spaces, returning the latest root space of the parameter. This means you can safely do `rootOf(space)` anywhere in a custom action, and always get the latest version.
```js
import { createSpace, rootOf } from 'spaceace';
Expand All @@ -389,8 +389,6 @@ Parameter: A space
Returns: The newest copy of the space, at the same level.
**Note**: This is a sister function of `rootOf(space)`, however where `rootOf(space)` returns the deepest root, this one returns the newest copy of the current level.
```js
import { createSpace, newestSpace } from 'spaceace';

Expand Down
2 changes: 1 addition & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('Space', function() {
assert.strictEqual(rootOf(this.space.characters[0]), this.space);
});

it('returns the deepest root space', function() {
it('goes all the way up the chain of parent spaces', function() {
assert.strictEqual(rootOf(this.space.userInfo.location), this.space);
});

Expand Down

0 comments on commit 84907ba

Please sign in to comment.