Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.67 KB

CHANGELOG.md

File metadata and controls

69 lines (49 loc) · 2.67 KB

2.0.0 (2019-11-18)

BREAKING CHANGES

  • postRequestMiddleWare: postRequestMiddleWare parameters has changed.

    To migrate the code follow the example below:

    Before:

    apiMod.registerPostRequestMiddleWare(apiMetas, res, next) {
        next(res);
    }

    After:

    apiMod.registerPostRequestMiddleWare(apiMetas, { data, response }, next) {
        console.log(data);
        next(response);
    }

Features

  • update dependencies and fix other potential security vulnerabilities

Bug fixes

  • postRequestMiddle typo error

Features

  • add globalPostRequestMiddleWare static method
  • add registerPostRequestMiddleWare instance method

Bug Fixes

  • fix the bug that the data option would be parsed first before processing in foreRequestHook function.

BREAKING CHANGES

  • ApiModule#globalForeRequestMiddleWare: method name changed from registerForeRequestMiddleWare
  • ApiModule#globalFallbackMiddleWare: method name changed from registerFallbackMiddleWare
  • registerFallbackMiddleWare(fallbackHook): change the second parameters to an object which contains error and data fields.
  • axios dependence: you need to install axios dependence by npm i axios -S additional, cause you can have better control of dependency version.

Bug fixes

  • getAxios: now return an axios instance by axios.create(config)

Features

  • adding unit test and coverage test.
  • better error tips when you passing invalid values to apiMetas or registering middlewares.

v1.3.2 (2019-4-2)

Bug fixes

  • fix default error handler would still be invoked when fallbackMiddle has been registered already.

Features

  • baseConfig: add baseConfig for creating axios by default configuration.