Skip to content
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

Point to ember-data-storefront instead of ember-cached-shoe #718

Merged
merged 1 commit into from Aug 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -380,24 +380,24 @@ export default Ember.Route.extend({

Shoebox gives you great capabilities, but using it in the real app is pretty rough. Have you ever thought that such kind of logic should be done behind the scenes? In a large codebase, defining `fastboot.isFastboot` conditionals can be a daunting task. Furthermore, it generates a lot of boilerplate code, which obscures the solution. Sooner or later coupling with `shoebox` will spread over all routes.

That's why [ember-cached-shoe](https://www.npmjs.com/ember-cached-shoe) was born.
Fortunately, there is an addon called [ember-data-storefront](https://embermap.github.io/ember-data-storefront/) that can help to alleviate this pain, thanks to its Fastboot mixin: https://embermap.github.io/ember-data-storefront/docs/guides/fastboot.

After installing and applying it, your routes can look like this:
After installing the addon and applying the mixin, your routes can look like this:

`app/routes/my-route.js`:

```javascript
import Ember from 'ember'
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model() {
// first call in a server makes actual ajax request.
// second call in a browser serves cached response
return this.store.findAll('posts')
}
})
```
And they still take advantage of caching in the `shoebox`. No more redundant AJAX for already acquired data. Installation details are available in the addon [README](https://github.com/appchance/ember-cached-shoe#ember-cached-shoe).
And they still take advantage of caching in the `shoebox`. No more redundant AJAX for already acquired data. Installation details are available in the addon [documentation](https://embermap.github.io/ember-data-storefront/docs).

### Rehydration

Expand Down