项目作者: topaxi

项目描述 :
A decorator for the Ember FastBoot shoebox.
高级语言: JavaScript
项目地址: git://github.com/topaxi/ember-shoebox-decorator.git
创建时间: 2017-09-08T14:35:18Z
项目社区:https://github.com/topaxi/ember-shoebox-decorator

开源协议:MIT License

下载


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

  1. ember install ember-shoebox-decorator

Usage

  1. import { shoeboxModel } from 'ember-shoebox-decorator';
  2. import fetch from 'ember-fetch';
  3. export default Ember.Route.extend({
  4. @shoeboxModel
  5. model() {
  6. return fetch('/api/v1/posts').then(res => res.json());
  7. },
  8. });

License

This project is licensed under the MIT License.