by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    illuminist
    @illuminist
    I don't think that's related redux-devtools, but from your code, you haven't configure redux store for inspection with redux-devtools
    Elijah Lucian
    @elucian1_gitlab
    hey all: how do i get typescript defs for redux-firestore/src/utils/query ?
    i get: Could not find a declaration file for module 'redux-firestore/src/utils/query'.
    rlagkrdy
    @rlagkrdy

    Hi. I have some problem about firestore.rules.
    In other collection can access resource.data,
    But only one collection can’t access, resource.data return undefined.

    When I test it, before already set mock data.

    I miss something?

    스크린샷 2020-03-06 오전 10.30.24.png
    스크린샷 2020-03-06 오전 10.30.56.png
    rlagkrdy
    @rlagkrdy
    Oh, I found problem in here
    :)
    Scott Prue
    @prescottprue
    @elucian1_gitlab types are at the top level of each library. How are you importing?
    Dustin Palea
    @Dkpalea

    Hey everyone, I hope you're all holding up okay... Does anyone know why a null value is being written over my redux state?

    I'm using a WHERE query in Firestore and when the response contains a document everything works as expected. Here's the response and my state:

    Screen Shot 2020-03-30 at 10.24.51 PM.png
    Screen Shot 2020-03-30 at 10.25.35 PM.png
    But when the query returns no matching documents it overwrites existing data in my store:
    Screen Shot 2020-03-30 at 10.25.52 PM.png
    Screen Shot 2020-03-30 at 10.26.09 PM.png
    To be clear, I'm setting these listeners manually one oafter the other via setListener() and not unsetting any in between the responses. Does anyone have any ideas as to why this is happening?
    Dustin Palea
    @Dkpalea
    Right now I'm thinking it might be related to prescottprue/redux-firestore#126 bc I can see data showing up in composite
    Albert Cui
    @albertcui

    Hello, I'd like to confirm my understanding of how the library works.

    I've noticed that DOCUMENT_MODIFIED seems to replace the entire doc instead of merging with the old doc.

    Based on the code in dataReducer.js (link), on DOCUMENT_MODIFIED, the previous doc gets entirely replaced. This is an issue because we have a nested object and don't want the selector to return new data if the nested object hasn't updated. It seems the only thing we can do is a deep-compare across all the keys in the object instead of a shallow reference compare here (i.e. ideally, old.nested_object === new.nested_object).

    Is our understanding correct? Is there a better way to get the behavior we're looking for? See code sample below:

    // Using redux hooks
    useSelector(state => state.firestore.data.myTask, (prev, current) => {
      // tasks have a lastUpdatedDate which is updated on the server
      // we don't want the selector to re-fire when only this field is updated
      // so do a specific check against the fields we care about
      return (
        prev.title === current.title &&
        prev.description === prev.description &&
        //! redux-firestore overrides the entire document
        //! so we can't do a quick sharing === sharing check
        //! this might have performance issues on heavily shared tasks...
        isEqual(prev.sharedWith, prev.sharedWith)
      );
    });
    Thanks for the help!
    Rusty Hoppins
    @rustiphyde
    Hello everyone, I am new to react-redux-firebase and redux-firestore but I've come to a point in my web app where it looks like the only way to accomplish the task at hand is if I implement these tools. I've only just recently started to learn about Hooks and I'm trying to figure out the best way to rewrite the code for my components to utilize these tools. I have some class components that have been taking state from my reducers and actions which are connected to my api functions created in a separate project file altogether. Basically I have a server side and a client side. My client side needs to be able to update the components in realtime of the chat application section of my website. My current redux folder has UserReducers, DataReducers, and UIReducers separated into their own files that get combined in my store.js file. I also have dataActions and userActions in their own respective files. There are a lot of each of them. I destructure the ones I need in each component from the appropriate file, pass them through connect using mapActionsToProps and then use the functions with this.props.functionName(args).
    I need a way to consolidate this down
    I also need to know if it's possible to use these tools effectively with my class Components or if I really need to be using hooks to accomplish my desired task
    Rusty Hoppins
    @rustiphyde
    I want to be able to listen to the chats without constantly calling my function and using all my bandwidth
    SyedAli310
    @SyedAli310

    @bushblade yeah there is not yet support for react-redux v6 (it just came out and it requires some pretty big changes). This error would be because you are trying to pull off state.fireStore instead of state.firestore (no capitals)

    Hello @prescottprue .I have the same problem as @bushblade and i have react-redux 5.1.1 installed but I'm still getting the same error. I'm really new to this. Can you help me out please!

    Capture.PNG

    @bushblade yeah there is not yet support for react-redux v6 (it just came out and it requires some pretty big changes). This error would be because you are trying to pull off state.fireStore instead of state.firestore (no capitals)

    Hello @prescottprue .I have the same problem as @bushblade and i have react-redux 5.1.1 installed but I'm still getting the same error. I'm really new to this. Can you help me out please

    Capture.PNG

    @prescottprue .This is where i used...Rest of the code is same as the above query i mentioned

    Okey Bond
    @okeybond
    Screenshot 2020-05-15 at 17.35.40.png
    I am trying to integrate firestore with next-js serverside rendering and I get the above error
    Okey Bond
    @okeybond

    codeexport default combineReducers(
    {
    firebase: firebaseReducer,
    firestore: firestoreReducer, }
    );code

    it doesnt seem to occur when i comment the firestore line

    Okey Bond
    @okeybond
    can anyone advise, please?
    gregfenton
    @gregfenton
    I did a thing. https://github.com/gregfenton/react-firestore-query-lab
    Feedback welcomed/encouraged.
    (my first NPM !! :bowtie: )
    Wendy Liu
    @lynklody
    @lestgabo @pedrospecter_twitter I'm having the same issue here. Would you mind elaborate a bit on how you solved it?
    gregfenton
    @gregfenton
    @lynklody - I think what @lestgabo describes is that the React component ends up rendering multiple times but only on later renderings does it actually have data. This is typical. You want to have a check in your rendering as to whether data has been received/loaded, and if not do something else like display a Loader.
    gregfenton
    @gregfenton
    One way to do that is to get state.firestore.status.requesting passed to your component as a prop, then check that value to see if it is true.
    const mapState = (state) => {
       // …
       return { requesting: state.firestore.status.requesting }
    }
    
    // …
    
    render() {
      const { requesting } = this.props;
      const loading = Object.values(requesting).some(a => a === true); // see if any objects exist
    
      if (requesting) return <MyLoadingComponent />;
    
      // …render component as usual
    gregfenton
    @gregfenton
    Has anyone seen a decent example of redux-firestore being used with “infinite scrolling”, or even just a simple page-by-page approach? I fear I’m doing a lot of work managing startAt values that maybe I don’t need to?
    Wendy Liu
    @lynklody
    @gregfenton Thanks, I finally understand why I'm having this issue here: I used isLoaded to check whether the todos object is loaded from firestore and forgot to add my other object into the checking after I modified the structure of my database, which has been haunting me for all these days.
    Wendy Liu
    @lynklody
    By the way is there any difference in using isLoaded and state.firestore.status.requesting to check the status of data loading?
    gregfenton
    @gregfenton
    I’m not entirely sure. It seems that firestore.status.requesting is maintained by redux-firestore’s reducers as it SET_LISTENER’s.
    isLoaded is maintained by react-redux-firebase’s reducers throughout all of its reducers’ actions.
    I suspect that their intentions are nearly identical when it comes to “listener” actions. There are likely subtle differences.
    Note: the r-r-f isLoaded is maintained for auth and profile. I doesn’t seem to come into play for listeners?
    Wendy Liu
    @lynklody
    I see. Thank you for the clarification.
    gregfenton
    @gregfenton
    Sure is quiet around here. Y’all good?
    zaptrem
    @zaptrem
    Is this compatible with Sign In With Apple?
    I'm getting "The custom token format is incorrect" when calling firebase.login(credentials) on credentials that work with signInWithCredential(credential). However, login seems to automatically create a user doc in firestore/users so I prefer it.