Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topaxi/ember-shoebox-decorator
A decorator for the Ember FastBoot shoebox.
https://github.com/topaxi/ember-shoebox-decorator
ember ember-addon ember-fastboot emberjs emberjs-addon fastboot shoebox
Last synced: 24 days ago
JSON representation
A decorator for the Ember FastBoot shoebox.
- Host: GitHub
- URL: https://github.com/topaxi/ember-shoebox-decorator
- Owner: topaxi
- License: mit
- Created: 2017-09-08T14:35:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T11:19:51.000Z (over 5 years ago)
- Last Synced: 2024-11-16T17:41:12.966Z (about 1 month ago)
- Topics: ember, ember-addon, ember-fastboot, emberjs, emberjs-addon, fastboot, shoebox
- Language: JavaScript
- Size: 188 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-shoebox-decorator
A decorator for the Ember FastBoot shoebox.
Puts the returned value from the model hooks into the shoebox and
fetches the data on the initial transition.Works with any route model hook (`beforeModel`, `model` and `afterModel`).
NOTE: Currently not working with Ember Data.
## Installation
```bash
ember install ember-shoebox-decorator
```## Usage
```javascript
import { shoeboxModel } from 'ember-shoebox-decorator';
import fetch from 'ember-fetch';export default Ember.Route.extend({
@shoeboxModel
model() {
return fetch('/api/v1/posts').then(res => res.json());
},
});
```## License
This project is licensed under the [MIT License](LICENSE.md).