Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion lib/adapters/choo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function plugin (parent, options) {
// content state
state.site = state.site || { loaded: false, p2p: false }
state.content = state.content || { }

// check if the content was preloaded
state.site.loaded = state.site.preloaded === true

// nanopage
state.page = new Page(state)
Expand All @@ -21,8 +24,11 @@ function plugin (parent, options) {
state.events.CONTENT_LOAD = 'content:load'

// listeners
emitter.on(state.events.DOMCONTENTLOADED, contentLoad)
emitter.on(state.events.CONTENT_LOAD, contentLoad)
// only load the content if it wasn't rehydrated by the server
if (!state.site.loaded) {
emitter.on(state.events.DOMCONTENTLOADED, contentLoad)
}

/**
* primary method
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function view (state, emit) {
`
}
}
```
```

</details>

Expand Down Expand Up @@ -161,4 +161,4 @@ For specifics on formatting directories and files, take a look at the dependenci

## Contributing

Enoki is early in development. If you’d like to see support for webpack, or whatever other tooling, feel free to contribute!
Enoki is early in development. If you’d like to see support for webpack, or whatever other tooling, feel free to contribute!