Git Product home page Git Product logo

react-my-eats's People

Contributors

eddielee394 avatar

react-my-eats's Issues

search functionality

  • add the capability for users to search for a recipe

Search Params

  • name
  • ingredients
  • user

custom loader functionality

custom wrapper component to handle loading indicators for optimistic ui rendering & React.Suspense defaults for component lazy loading.

recipe ui views

  • Create a list view which includes all the recipes
  • Create a recipe detail view to display each recipe

logic for special ingredients display

Ingredients with a matching ingredientId listed in the specials response should also show the special title, type and text under the ingredient name

Responsive header and widget ui

Fix logo and header components for small screens
Fix issue where widget containers are displaying in sidebar if child element is hidden
Screenshot_20200102-135052_Chrome

gh pages routing

  • need to resolve the issue where paths aren't being routed to the correct base url when deployed to github.io

recursively validate response data

When data is returned from a response, currently I'm using an inline loop to handle validating any data contained within arrays deeply nested in the response object.

Ideally I'd like to avoid inline logic within the validation schema & instead abstract that logic into a separate method validateApiResponse(). This would check if the response object contains any nested arrays & if so, then map over them comparing each iteration to the parent object schema.

Approaches taken so far

  • Using a for in loop and hasOwnProperty(), I'm able to do a shallow mapping that checks if there are multiple top level objects in the response and validate those individually, but it doesn't handle nested arrays within the top level objects.
      let data = {};
      for (let key in response.data) {
        if (response.data.hasOwnProperty(key)) {
          data[key] = convertData(response.data[key]);
        }
      }
  • Inline map() over any known nested arrays. The trade-off with this approach is that it requires us to know whether the incoming response object contains any arrays before hand, in order to loop over them in the validation schema.
    const convertData = data => {
      return {
        uuid: data.uuid,
        title: data.title,
        //...
        directions: data.directions.map(d => {
          return {
            instructions: d.instructions,
            optional: d.optional
          };
        })
      };
    };

	//...
    const rawData = response.data;
    const data = rawData.map(d => convertData(d));

Possible Solutions

  • Recursively apply the validation method to any deeply nested enumerable objects (i.e. arrays).
  • Check if a nested object in the response is an array, then somehow loop over and apply the appropriate validation.

crud functionality

Create a view to add and update recipes or specials. Image upload not required. Both endpoints support GET, POST and PATCH.

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.