Tech Tim Profile picture
Jul 21 8 tweets 5 min read
Learn JS Patterns - 1 Singleton
- harder to write unit test for app
- consider #Redux as a (kind of) singleton
- a bit breaks Single Responsibility Principle, because it solves two problems (keep one instance for a class, assign a global access point to the instance)
@keurplkar Image
@keurplkar Learn JS Patterns - 2 Proxy Pattern

- Proxy can help on validating, formatting, notification, debugging etc
- It add control over the behavior of an object, so over using Proxy may grant performance issue

@lydiahallie
@keurplkar 3 Provider Pattern

- Very common in React, make data accessible to multiple child components to avoid props drilling
- For example #mui theme provider provider pattern diagram in...
@keurplkar 4 Prototype
For example
dog1.prototype.bark='wow'

The prototype pattern is a useful way to share properties among many objects of the same type.

Careful, avoid #prototype pollution
@keurplkar 5 Container/Presentation

- use container to fetch data and wrap presentation component
- use presentation component to show UI A diagram for container/pre...
But actually, to use hooks may be better in React application
@keurplkar 6 Observer

we can use the observer pattern in many ways, it can be very useful when working with **asynchronous, event-based** data.

- Good to implement single-responsiblity principle
- If an observer becomes too complex, may cause performance issues Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Tech Tim

Tech Tim Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @TechTim42

Jul 20
What is a Crucial Conversation?

- opposing opinions
- strong emotions
- high stakes

🧵👇 triangle of crucial convers...
@josephgrenny Knowing how to handle a crucial conversation.

It could help your health, strengthen your relationships, increase your influence and improve your organisation.
@josephgrenny 3 - We usually choose the wrong topic, choose easy and recent topic for the crucial conversation, which may not lead to the root cause.
Try CPR
- Keep it at Content, wrong name pronounce
- Move to Pattern, in every meeting
- Talk Relationship, => feel not valued
Read 4 tweets
Jul 15
#TIL

How much time will you spend in meetings in your work time?

- 20% to 40% says cultureamp.com
- It will be 4 years in a person's whole life

There is 4P Method to help you master your meetings.

✓Purpose
✓Product
✓Personal Benefit
✓Process
From their research, they found a few interesting percentages.
- Believes meeting are #1 waste of time (49%)
- Admits to deliberately missing meetings (96%)
- Daydreams in meetings (91%)
- Does other work (73%)
- Sleeps in meetings (39%)
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(