Hi mọi người,
Em đang làm app có dùng đến isolate để prepare, và loading cho nhanh hơn. Không biết mọi người có dùng lib nào để bớt boilercode khi làm isolate cho heavy state không ạ.
Cảm ơn mọi người
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Chắc em cần paste code của em xem anh có làm gọn hơn được không thôi chứ bản chất Isolate nó cũng chỉ là 1 cái event loop, anh nghĩ cũng không có gì đơn giản hơn nữa em ạ.
Hi a,
Bây giờ em có khá nhiều usecase cần sử dụng khoảng 10 method có trong local repository (database query heavy search & similarity search). Có cách nào để hạn chế phải viết 10 cái top-level function kia ko ạ, hoặc a có từng dùng lib nào đỡ boilerplate code thì cũng giảm được effort ạ.
Thank a.
Vậy tức là câu hỏi của em là: có thư viện nào có thể giảm được số lượng dòng code phải viết cho 10 method kia đúng không em? Nếu đúng, em có thể dùng thư viện rxdart nhé.
Dạ đúng ạ,
Em đang tham khảo lib này:
https://github.com/alphamikle/isolator
anh có từng dùng lib khác, hoặc từng viết riêng thành 1 module để reuse code cho vụ này thì cho em tham khảo ạ
Thank a
Nếu vậy, anh thấy em có thể tách thành lớp DataFetcher để common code em ạ: