Git Product home page Git Product logo

Comments (6)

sars avatar sars commented on August 21, 2024

Hi, I'm trying to figure out how to fetch 2 things: 1 always on server and client, and the second one only on server.

in this case (all on server and some on client) you need to implement filter only on client.

do yo use the latest 1.0.x branch version?

from redux-async-connect.

andresgutgon avatar andresgutgon commented on August 21, 2024

Yes, I'm using version 1.0.0-rc2.

Now I removed filter from server and added to <ReduxAsyncConnect/> component on client.

But request is done on server because when page render I do not see that request on Network panel on Chrome Dev Tools.

from redux-async-connect.

andresgutgon avatar andresgutgon commented on August 21, 2024

I don't khow how filtering on the client is not allowing to fetch deferred resources on the server.

I've check your code and I don't see it.

from redux-async-connect.

andresgutgon avatar andresgutgon commented on August 21, 2024

I'm on rc4 v1. I can see that when async connect hight order component load checks if there was already loaded on the server: https://github.com/Rezonans/redux-async-connect/blob/v1/modules/ReduxAsyncConnect.js#L110

So if I filter on the server this way:

@asyncConnect([{
  deferred: true,
  promise: (options) => {
    return options.store.dispatch(loadDeferredThing(options.params.id));
  },
}])

loadDeferredThing won't be loaded at all. But if I filter it only on the client on the server that data will be fetched. So that do not works for me. Because I want not to fetch loadDeferredThing on the server.

from redux-async-connect.

andresgutgon avatar andresgutgon commented on August 21, 2024

I made a PR to illustrate my issue #63

from redux-async-connect.

djeeg avatar djeeg commented on August 21, 2024

In RC4, it looks like the filter parameter has moved from <ReduxAsyncConnection> to loadOnServer

function loadOnServer(args) {
  var result = loadAsyncConnect(args);

function loadAsyncConnect(_ref) {
  var components = _ref.components;
  var _ref$filter = _ref.filter;
  var filter = _ref$filter === undefined ? function () {
    return true;
  } : _ref$filter;

from redux-async-connect.

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.