Skip to content

redux api middleware for separate your api routes, api actions, and interceptors. provide state normalization, db reducer

License

Notifications You must be signed in to change notification settings

aliaksandr-master/multi-routing-api

Repository files navigation

npm npm Dependency Status devDependency Status

multi-routing-api

Predictable fetch for redux. Used normalizr.

$ npm install multi-routing-api --save
// main-api.origins.js
import { origin, TransportJSON } from 'multi-routing-api';



export const mainResource = origin({
  baseUrl: `${window.location.protocol}//${window.location.host}/api/`,
  transport: new TransportJSON()
});
// main-api.entities.js
import { schema } from 'multi-routing-api/lib/redux';


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');

About

redux api middleware for separate your api routes, api actions, and interceptors. provide state normalization, db reducer

Resources

License

Stars

Watchers

Forks

Packages

No packages published