Code Monkey home page Code Monkey logo

Comments (4)

vitorreis avatar vitorreis commented on July 4, 2024 1

+1 here

from redux-object.

yury-dymov avatar yury-dymov commented on July 4, 2024

This is a basic redux question. You are supposed to dispatch a redux action, which is handled by reducer function and apply a desired change to your store. redux-object is just a utility, which helps to build JS object from normalized data, and knows very little about your application and storage architecture.

from redux-object.

benlieb avatar benlieb commented on July 4, 2024

I disagree that this should somehow be seen as obvious. We all know how redux works, else we wouldn't be here. The fact that you have used redux in the name of your library is confusing, there are others even on this issue that feel confused. If your library should have no knowledge of redux, why is redux in the title? Shouldn't it be called normalized-object?

In my case the normalized data that redux-object is building from, has redundant information in it, so it is not obvious to change. My hope was that this library would take care of all of this reference data simply. For example say that I have a table of people, and people have favorite_restaurants. What if 2 people have the same favorite restaurant id:4, and I want to remove that restaurant from my store. When this data comes from the server favorite_restuaruant is in the restaurant array, but also is referenced by the people who have it as a favorite. As it is, it's easier to just post to the server and remove the restaurant and update the store from the server.

from redux-object.

yury-dymov avatar yury-dymov commented on July 4, 2024

@benlieb, listen, I didn't try to insult you by saying "basic". My point was that everything what is supported is written in README. Otherwise, I provided a valid answer for the question.

Naming is the most hard problem in CS and I am not going to apologize for picking this name over another. Other folks were able to find it and use for quite some time, so maybe it's not perfect but works.

In my case the normalized data that redux-object is building from, has redundant information in it, so it is not obvious to change.

To me this sounds a bit weird. If data is normalized, it shouldn't have redundant information in the first place. In your example with restaurants, I would expect to have three entities: Restaurants, People and PeopleToRestaurants. If somebody removes restaurant from favorites, you would delete one record from the last one and other people would be not affected.

from redux-object.

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.