Package Exports
- redux-routed-api-middleware
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-routed-api-middleware) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
redux-routed-api-middleware
Predictable fetch for redux. Used normalizr.
$ npm install redux-routed-api-middleware --save
// main-api.origins.js
import { ResourceOrigin, TransportJSON } from 'redux-routed-api-middleware';
export const mainResource = ResourceOrigin({
baseUrl: `${window.location.protocol}//${window.location.host}/api/`,
defaultTransport: new TransportJSON()
});
// main-api.entities.js
import { schema } from 'redux-routed-api-middleware';
export const EntitySandboxComponent = new schema.Entity('sandbox_component');
// resource/components.js
import { EntitySandboxComponent } from '../main-api.entities';
import { mainResource } from '../main-api.origins';
export const resource = mainResource('/components', {}, { responseSchema: [ EntitySandboxComponent ] });
export const getUiAllComponentsAction = resource('GET');