js-data-http
js-data-http copied to clipboard
Docs issue: js-data-http
http://www.js-data.io/v3.0/docs/js-data-http
The code does not compile on TS version 3.1.6:
import { DataStore } from 'js-data';
import { HttpAdapter, addAction } from 'js-data-http';
const store = new DataStore();
const httpAdapter = new HttpAdapter();
store.registerAdapter('http', httpAdapter, { 'default': true });
// Setup action: GET /reports/schools/:school_id/teachers
@addAction('getTeacherReports', {
pathname: 'teachers',
method: 'GET'
}); // <---- Error: Declaration expected
store.defineMapper('school', {
endpoint: 'schools'
});