Registry / testing / factorial-mobx-rest-axios-adapter

factorial-mobx-rest-axios-adapter

JSON →
library1.0.1jsnpmunverified

Official axios HTTP adapter for mobx-rest library. Version 1.0.1 provides a bridge between mobx-rest's data layer and axios for making API requests. Lightweight and focused, it is released on an as-needed basis. Unlike custom adapter implementations, this is the first-party solution that ensures compatibility with mobx-rest's internal API client configuration.

npm install factorial-mobx-rest-axios-adapter
INSTALL
IMPORT
SIG · FACTORIAL-MOBX-RES
F
factorial-mobx-rest-axios-adapter
testingjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import adapter from 'mobx-rest-axios-adapter'
const adapter = require('mobx-rest-axios-adapter')
ES module default import. CommonJS require also works for this package.
apiClient
import { apiClient } from 'mobx-rest'
apiClient is exported from mobx-rest, not from this adapter. The adapter itself is passed as the first argument.

Shows how to import the default adapter and use it with mobx-rest's apiClient to set up the API client.

import adapter from 'mobx-rest-axios-adapter'; import { apiClient } from 'mobx-rest'; const apiPath = '/api'; apiClient(adapter, { apiPath });
Debug
Known issues
gotchaAdapter must be the default import from this package
fix
Use import adapter from 'mobx-rest-axios-adapter' (not named import)
affects: >=1.0
gotchaaxios must be installed as a peer dependency
fix
Run npm install axios in your project
affects: >=1.0
Errors
Common errors & fixes
Cannot find module 'mobx-rest-axios-adapter'
Package not installed or import path incorrect
fix
Install the package: npm install mobx-rest-axios-adapter
adapter is not a function
Incorrect import (e.g., named import instead of default)
fix
Use default import: import adapter from 'mobx-rest-axios-adapter'
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
axiosrequiredpeer dependency - used to make HTTP requests
mobx-restrequiredpeer dependency - provides the apiClient function that consumes this adapter
Agent activity
2 hits · last 30 days
node
2
Resources
factorial-mobx-rest-axios-adapter — npm install factorial-mobx-rest-axios-adapter · libregistry