Spencer FengMastering the Art of Mocking ES Modules in JestWe value jest.spyOn’s flexibility for modifying function returns, but it falls short with ES modules. This article introduces an…Dec 13, 2023Dec 13, 2023
Spencer FengTesting JavaScript Code with Timeouts and PromisesTesting JS code with timeouts and promises can be challenging. In this article, we show an example to test such code.Jul 1, 2023Jul 1, 2023
Spencer FengHow to use PlantUML in VSCodeLearn to create diagrams with code easily using PlantUML & VSCode. Our article provides step-by-step instructions to streamline the…Mar 5, 2023Mar 5, 2023
Spencer FengCreate an abortable API using AbortController and AbortSignalHow create an abortable API using AbortController and AbortSignal the right way.Jul 25, 2022Jul 25, 2022
Spencer FengThe journey of creating a serverless service to scrape contents from a web pageIn this article, I will share my experience of using Serverless Framework to build a service to extract the HTML content of a web page and…Apr 30, 2022Apr 30, 2022
Spencer FenginBetter ProgrammingStore an Array of Custom Data Types in Core Data With Transformable and NSSecureCodingPersist the user’s drawings in Core DataMar 5, 20221Mar 5, 20221
Spencer FengHow to replace async code using completion handler with Future from Combine FrameworkThis article talks about how to turn your callback based API into a reactive based API using Future from Combine Framework.Nov 8, 2021Nov 8, 2021
Spencer FengHow to avoid race condition when accessing properties in a singleton using GCDHow to avoid race condition when accessing properties in a singleton using Grand Central DispatchNov 4, 2021Nov 4, 2021
Spencer FengHow to mock lodash throttle in JestThis article talks about how to mock lodash throttle function in Jest and this techique can be applied to lodash debounce function as well.Aug 14, 2021Aug 14, 2021
Spencer FengCreate a custom file upload control in ReactThe file upload control that comes with browsers looks ugly. This article talks about how to create a custom file upload control in React.Mar 20, 2021Mar 20, 2021