Coder Social home page Coder Social logo

Comments (8)

egeriis avatar egeriis commented on June 11, 2024

Let's get a PR 🎉

from redux-json-api.

Nopzen avatar Nopzen commented on June 11, 2024

Ill try to get to it tonight, some RL stuff came in the way.

Scratch that, ill have a look in the weekend.

from redux-json-api.

egeriis avatar egeriis commented on June 11, 2024

@Nopzen Had a chance to look at this?

from redux-json-api.

Nopzen avatar Nopzen commented on June 11, 2024

@egeriis Sorry no. I'll try to take a look asap, i got to open some codebase today where i use this.

from redux-json-api.

Nopzen avatar Nopzen commented on June 11, 2024

@egeriis so i can see i just use a very basic example:

store.dispatch(setAxiosConfig({
    baseURL: 'http://localhost:3000/'
}));

And as i can see out of the code here:
https://github.com/redux-json-api/redux-json-api/blob/master/src/jsonapi.js#L194

[API_SET_AXIOS_CONFIG]: (state, { payload: axiosConfig }) => {
    return imm(state).set(['endpoint', 'axiosConfig'], axiosConfig).value();
  },

We are basically on the key endpoint setting the given Axios config given as param to the action.

My assumtion here is we can pass a config as the given example of the Axios repo: https://github.com/axios/axios#axioscreateconfig? So supporting: baseurl, timeout & headers?

Also i wonder why is it stored on a key called endpoint should it not just be axiosConfig ??

from redux-json-api.

egeriis avatar egeriis commented on June 11, 2024

Yeah, the configuration you provide are directly proxied to axios.

Also i wonder why is it stored on a key called endpoint should it not just be axiosConfig ??

Legacy. We used to have endpoint and base path specified here. Feel free to move it. Should not break anything.

from redux-json-api.

egeriis avatar egeriis commented on June 11, 2024

I think I just discovered that we haven't documented the new resolve value from readEndpoint, i.e. that it now returns an ApiResponse instance.

from redux-json-api.

Nopzen avatar Nopzen commented on June 11, 2024

So okay I'am back on track now.

So i, working on this PR again and for now i will update the documentation on how to get going, and setting up the axios config.

And on this comment form @egeriis

Legacy. We used to have endpoint and base path specified here. Feel free to move it. Should not break anything.

I investigated it broke a lot by removing the endpoints key, i expected this, but I've refactored it to a working state again, and are no building tests for this use case, meanwhile i explored this refactor i discovered we didn't have test cases for the redux-thunk actions, these are the one i will create a bare minimum test cases that covers my refactor.

The test setup will include as of now installation of package Chai, and moxios (mocking axios), i hope to have a pr soon.

Sorry for the delay of things.

from redux-json-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.