Skip to content

Update routes-defining.md #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions routes-defining.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ Most of the time your routes will look like the above:
```
In this case if the user were to go to: `http://localhost:8080/#!/about` the section defined at `require('../sections/About')` would be run (`bigwheel` will go through `About`'s `init`, `resize`, `animateIn`, `animateOut`, `destroy` methods)

**_Note currently `bigwheel` uses "hash bang" routing but could easily be made to handle the history api_**
**_Note currently `bigwheel` uses "push state" routing but could easily be made to use hash bang urls. To use hash bang urls set `pushState: false`_**

**_Gotcha: In all these examples we've been defining routes inline in objects.
It might be tempting to require sections outside of the routes object but this can cause a large gotcha for instance if we did:_**
@@ -125,4 +125,4 @@ module.exports = {

As you can see to define multi section routes you just define your sections in an array using the standard form or using a section descriptor. What will happen is that when the route resolves all the sections will be run in tandem so all `init`, `resize`, `animateIn`, `animateOut`, and `destroy` calls will happen at the same time for all multi sections.

The reason why this is handy is that if you define `Menu` as an `Object` instead of a `function` `Menu` will always be persistent and it can react to sections coming in for instance highlighting the correct menu button in the `animateIn` function.
The reason why this is handy is that if you define `Menu` as an `Object` instead of a `function` `Menu` will always be persistent and it can react to sections coming in for instance highlighting the correct menu button in the `animateIn` function.