Coder Social home page Coder Social logo

Comments (1)

junhoyeo avatar junhoyeo commented on May 20, 2024

스크린샷 2022-05-27 오전 12 06 33

  • 지금은 API 에서 에러가 발생하면 .catch(() => 0) 을 사용해서 기본값을 반환하고 있습니다.
  • 다음과 같이 개선할 수 있습니다.
    • @bento/core 를 외부 API 또는 Serverless Functions 에서 호출하는 경우:
      1. 에러가 발생했음을 클라이언트가 알 수 있게 합니다.
      2. 클라이언트가 에러가 발생했을 때, 마지막으로 쿼리한 값을 사용하거나 기본값을 사용하도록 합니다.
    • @bento/core 를 클라이언트에서 호출하는 경우:
      1. 해당 로직의 호출을 다루는 클래스에 특정 형태의 storage(예: localStorage)를 주입할 수 있게 합니다.
      2. 클라이언트가 에러가 발생했을 때, (1에서 주입한 storage에 저장된) 마지막으로 쿼리한 값을 사용하거나 기본값을 사용하도록 합니다.

from bento.

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.