Skip to content

Instantly share code, notes, and snippets.

@long-nc
long-nc / Code Review.md
Last active June 7, 2021 07:45
Code Review

Code review:

Lưu ý:

  1. Cài đặt thư viện phải dùng thông qua yarn, tuyệt đối không dùng npm để cài. Dùng lệnh npm i -g yarn để cài yarn.

  2. Trước khi đẩy code lên cần kiểm tra lại tất cả lỗi được thông báo bởi eslint bằng cách chạy lệnh yarn lint. Ở trong từng file cũng sẽ thông báo lỗi cụ thể trên từng dòng nếu bật sẵn plugin eslint. Các lỗi có thể fix tự động bởi eslint có thể fix dùng lệnh yarn lint-fix hoặc dùng tổ hợp cmd+shift+p => ESLint: Fix all auto-fixable problems

  • Trường hợp có lỗi:
    Eslint failure
  • Trường hợp hết lỗi:
    Eslint success
@long-nc
long-nc / falsehoods-programming-time-list.md
Created April 12, 2021 03:10 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@long-nc
long-nc / react-rendering.md
Created March 23, 2021 19:35 — forked from tuhuynh27/react-rendering.md
A (Mostly) Complete Guide to React Rendering Behavior

Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)

A (Mostly) Complete Guide to React Rendering Behavior

Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.

"Render" là gì

Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.

Tìm hiểu về Reactive Programming

1. Khái niệm reactive programming

Reactive programming (RP) là một mô hình lập trình dùng để xử lý các sự kiện bất đồng bộ mà theo wikipedia định nghĩa đầy đủ là:

Reactive programming is a declarative programming paradigm concerned with data streams and the propagation of change. With this paradigm it is possible to express static (e.g., arrays) or dynamic (e.g., event emitters) data streams with ease, and also communicate that an inferred dependency within the associated execution model exists, which facilitates the automatic propagation of the changed data flow.

Một định nghĩa ngắn gọn nhưng diễn giải đầy đủ đặc tính cũng như mục đích của reactive programming, chúng ta sẽ cùng mổ xẻ nó trong bài viết này: