Coder Social home page Coder Social logo

Comments (17)

egeriis avatar egeriis commented on June 2, 2024 1

@tomharvey Are you open to a PR for these changes?

@dvidsilva Let's see if Tom responds first πŸ™‚

from redux-json-api.

tomharvey avatar tomharvey commented on June 2, 2024 1

Time to close the issue?

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

You simply want to specify the base URL in the Axios config. That’s the equivalent.

from redux-json-api.

pedrovinicius avatar pedrovinicius commented on June 2, 2024

Ok, I wrote that way:

store.dispatch(setAxiosConfig({
  baseURL: 'https://my.api/v2',
  headers: {
    'Access-Token': currentUser()
  }
}));

Now, how can I fetch an endpoint with its related resources (include)? Do I need to hardcode the include at the end of the path when using readEndpoint?

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

Yeah, readEndpoint doesn't care about parsing the URL you're providing. So you can pass any query param through there.

from redux-json-api.

dvidsilva avatar dvidsilva commented on June 2, 2024

Thanks for the hard work @egeriis , using setAxiosConfig worked perfect, Any plans for updated documentations and examples? the linked example repo still uses the old way.

I have some time this week, if no one else is on it I can take a stab at it.

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

Good to hear @dvidsilva. Unfortunately the example repo is not in my control πŸ˜•

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

The docs are updated. But be sure to check the 2.0 branch.

from redux-json-api.

dvidsilva avatar dvidsilva commented on June 2, 2024

@egeriis no problem. If I create a sample repo for v2 and is good, can it get linked? might be useful for other folks.

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

@dvidsilva Oh yeah, for sure!

from redux-json-api.

pedrovinicius avatar pedrovinicius commented on June 2, 2024

@egeriis, does setAxiosConfig accept any config option officially supported by Axios?

from redux-json-api.

dvidsilva avatar dvidsilva commented on June 2, 2024

@egeriis Actually this was faster, I changed the redux-json-api-demo repo to use v2, so people can also have an example of upgrading steps. https://github.com/dvidsilva/redux-json-api-demo

https://github.com/dvidsilva/redux-json-api-demo/commits/master

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

@pedrovinicius Yes, any config option. They are passed directly.

from redux-json-api.

tomharvey avatar tomharvey commented on June 2, 2024

@egeriis I'm good with @dvidsilva approach if you guys are. I've yet to upgrade to v2 so I can't really comment on any details, but more than happy to have someone else feed into the guide.

Will be sure to raise a PR with @dvidsilva if I think of anything, while I upgrade to v2, which could help the guide.

from redux-json-api.

tomharvey avatar tomharvey commented on June 2, 2024

I've also merged @dvidsilva into my repo.

from redux-json-api.

egeriis avatar egeriis commented on June 2, 2024

Good call @tomharvey

from redux-json-api.

dvidsilva avatar dvidsilva commented on June 2, 2024

@egeriis sorry, the docs are still not updated, the configure still has the old docs, https://github.com/redux-json-api/redux-json-api/blob/v2.0.0/docs/set-up-configure.md

I can make some time this week and send a PR

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.