non-enumerable object properties are lost after passing an object to workerize.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- web-dev
Hướng nghiên cứu
Bắt đầu với ví dụ workerize-loader và tái hiện khác biệt đã được báo cáo giữa các đối tượng Firebase và kết quả đã lọc. Kiểm tra ranh giới của lệnh gọi worker và README để xác định liệu việc giữ lại các thuộc tính không thể liệt kê có phải là chủ đích hay không. Được xem là hoàn tất nếu các thuộc tính id được giữ lại xuyên suốt lệnh gọi hoặc hành vi quan sát được được ghi lại một cách rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Here's a real life example:
// The main thread
import Worker from 'workerize-loader!./workers';
import getCompaniesFromFirebase from './getCompaniesFromFirebase';
const worker = Worker();
const {
filterCompaniesByTypes
// Other modules
} = worker;
(async () => {
const companies = await getCompaniesFromFirebase();
// typeof companies[0].id === "string" // true
const companiesFiltered = await filterCompaniesByTypes(companies, ['company-type-1', 'company-type-2']);
// typeof companiesFiltered[0].id === "string" // false
// typeof companiesFiltered[0].id === "undefined" // true
})();
// The worker
import intersection from 'lodash/intersection';
export const filterCompaniesByTypes = (companies, typesToFilerBy) => {
return companies.filter(({ types, id }) => {
// typeof id === 'undefined' // true
return intersection(types, typesToFilerBy).length > 0;
});
};
In the given example the getCompaniesFromFirebase() function returns an array of objects. Each object has some properties, inluding the id property that is non-enumerable.
After executing the filterCompaniesByTypes() function (which is a web worker function) I receive a filtered array. All id properties are gone.
if it's the desired behaviour (or an unpleasant, but expected, side-effect) not a bug, then it would be good to mention it in the readme.
- Ngôn ngữ chính
- JavaScript
- Star
- 4.4k
- Fork
- 87
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của developit/workerize
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Integration with Rollup Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Arrow functions Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của developit/workerize
Issue tương tự
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Improve Title Support Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·