Open in app

Sign In

Write

Sign In

Mastodon
MING WU
MING WU

24 Followers

Home

Lists

About

Published in

Dev Genius

·Pinned

Mastering TypeScript Decorators: A Comprehensive Guide to Enhancing Your Code

Why do we need a decorator? If you’re new to TypeScript decorators, you may be wondering why they’re necessary. Before we delve into the answer, let’s take a look at a small code snippet. The getHomeAddress function violates the single responsibility principle because it performs multiple tasks that should be handled by separate functions. Specifically, the…

Typescript With React

9 min read

Mastering TypeScript Decorators: A Comprehensive Guide to Enhancing Your Code
Mastering TypeScript Decorators: A Comprehensive Guide to Enhancing Your Code
Typescript With React

9 min read


Published in

Dev Genius

·Pinned

Learn rxjs in an easy way

Unlike Object-oriented programming (where states and behaviors are coupled together into an object), Reactive programming is a different programming mindset. It focuses on reacting to changes in a pure-function way. If you have ever used excel you already know what reactive means. …

Rxjs

9 min read

Learn rxjs in an easy way
Learn rxjs in an easy way
Rxjs

9 min read


Published in

Dev Genius

·Pinned

A quick guide about Dependency Injection (in Angular/React)

In fact, DI (Dependency Injection) is a super simple concept that is widely used in software development. It basically means that when a component needs some props to render, those props are passed from the outside of this component instead of creating these props directly inside of this component. These…

React

4 min read

A quick guide about Dependency Injection (in Angular/React)
A quick guide about Dependency Injection (in Angular/React)
React

4 min read


Published in

JavaScript in Plain English

·May 11, 2022

The Difference Between jest.spyOn and jest.mock

When I first started to write unit tests for react applications, I found that it is confusing whether I should use jest.spyOn or jest.mock. The golden rule is that: jest.mock is used to mock a JavaScript module. 2. jest.spyOn is used to mock what we imported from that module. …

Jest

2 min read

Jest

2 min read


Sep 12, 2021

Some thoughts about unit test in React

Do not wrap fireEvent in “act” or “await waitFor” If we are testing with fireEvent in react-testing library but found this error in the console Warning: An update to Example inside a test was not wrapped in act(...) It means that we did not wait for react to flush the…

React

4 min read

Some thoughts about unit test in React
Some thoughts about unit test in React
React

4 min read


Aug 21, 2021

Learn Git in a scenario-based way

The git commands you will learn: git stash git reset git cherry-pick git blame git reflog git rebase These are all very important and easy-to-understand git commands in daily dev workflow. git stash 1. I am currently in ticket001 branch adding a new feature. I just finished 50% of the work but I have not committed anything. I am assigned an emergent bug fix ticket. I need to do the bug fix ticket right now. What should I do with my uncommited work?

Git

5 min read

Learn Git in a scenario-based way
Learn Git in a scenario-based way
Git

5 min read


Aug 13, 2019

Things You Need to Know About TypeScript

This passage is not finished and is still in progress… Numbers: const bigNumber:number=1_100_200_3000 //much easier to read; what this compiles to javascript is const bigNumber=11002003000; In typescript, using underscore makes your code easier to read. 2. Add “!” to tell ts to ignore it 3. keyof interface IPet{ name:string…

Typescript

2 min read

Things You Need to Know About TypeScript
Things You Need to Know About TypeScript
Typescript

2 min read

MING WU

MING WU

24 Followers

aws solution architect associate, developer associate, top 11% in stackoverflow, https://linktr.ee/mingw

Following
  • Bennett Garner

    Bennett Garner

  • Dr. Derek Austin 🥳

    Dr. Derek Austin 🥳

  • Shuai Li

    Shuai Li

  • Carl Vitullo

    Carl Vitullo

  • Tom Jay

    Tom Jay

See all (169)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams