Giter VIP home page Giter VIP logo

dcard-reader-react's Introduction

dcard-reader-react

Getting Started

npm install
npm run start

Now open http://localhost:8080

Implementation

Mock

Design Architecture

BoardCard Rendering

隨著捲軸滾動,文章會load進越來越多。因此在 Board.jsx 裡 keep 動態增長的array, 存在state裡,以props的方式傳給BoardCard。 當API呼叫時,再去更新array。

判斷何時呼叫Dcard API load 進更多文章

判斷當使用者滑到底時要呼叫API, 但因為CSS的設定讓滑到底沒有一個確切的值來判斷,因此用一個範圍來界定。因此設定一個isLoadMore 的state 來避免多餘的呼叫。 另外,state中也保有lastPostId 來紀錄目前最後一個PO文的ID。

API 呼叫

使用 AJAX 的方式,傳回JSON,再做處理,取id, title, excerpt的資料。

Problems I encounterd

  • 當我要偵測scrolling這個動作的時候,因為想要在Board.jsx 裡去偵測,因此拉霸在Board裡面。正在思索有沒有辦法在外面scroll, 但讓Board裡面也可以偵測到。

dcard-reader-react's People

Contributors

mimiliaogo avatar

Watchers

 avatar

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.