Giter VIP home page Giter VIP logo

Comments (6)

aviv1620 avatar aviv1620 commented on July 19, 2024

I also agree with refactoring.
Do we need to save the data in SessionStorage?
or we can remove the Context completely and use the SearchParams hook in components?

replace

  const { operatorId, lineNumber, timestamp, routes, routeKey } = search```

with

const  [operatorId,setOperatorId] = useSearchParams('')
const  [lineNumber,setLineNumber] = useSearchParams('')
const  [routes,setRoutes] = useSearchParams('')
const  [routeKey,setRouteKey ] = useSearchParams('')
const  [timestamp,setTimestamp] = useSearchParams(moment().valueOf())

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

@ArkadiK94 @aviv1620
I support both suggestions.
Having the search parameters stored in the local storage will allow us to retrieve the latest search for the user. It's very likely that our users will want to search the same line over and over.
However, it complicates things, and I prefer simplicity when maintaining such a project.

Feel free to make it comfortable - your help is very appreciated

from open-bus-map-search.

aviv1620 avatar aviv1620 commented on July 19, 2024

I think we need merge this issue with issue #83 and issue #71.
The problems come from the same place on the code.

from open-bus-map-search.

giladfuchs avatar giladfuchs commented on July 19, 2024

what do you think about redux?

from open-bus-map-search.

aviv1620 avatar aviv1620 commented on July 19, 2024

@giladfuchs
We store the data on URL params.
So I think that the useSearchParams have some logic that similar to state management.

from open-bus-map-search.

NoamGaash avatar NoamGaash commented on July 19, 2024

@giladfuchs overcomplicated for our needs.
IMO, using react context will be better fit for our needs.

from open-bus-map-search.

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.