Open in app

Sign In

Write

Sign In

Adam Klein
Adam Klein

83 Followers

Home

About

Apr 21, 2021

Understanding cybersecurity through a riddle. And a cat

Imagine you have a cat, named Sniffles. You love that cat very much. Unfortunately, you have to give it away, because you developed an allergy to cats. It’s a very sad day for you. But you don’t want Sniffles to be sad as well. So you decide to send it…

Cybersecurity

3 min read

Understanding cybersecurity through a riddle. And a cat
Understanding cybersecurity through a riddle. And a cat
Cybersecurity

3 min read


Nov 6, 2020

Why impact is not about the budget, but about the passion

Businesses don’t focus enough on impact, and quite reasonably. How do you measure impact, and how can you be certain it will make your company better? 7 years ago, my partner and I have founded a company called 500Tech. When we just started, that name meant nothing. …

Impact

2 min read

Why impact is not about the budget, but about the passion
Why impact is not about the budget, but about the passion
Impact

2 min read


Published in UX Collective

·Jul 12, 2020

If you want UX inspiration, eat a banana

Banana — the perfect packaging You all know the feeling when you get something delivered to your home, or picked up from the store, and the package is just so complicated to open. You’re struggling with the package thinking: “Why are they making this so difficult to open? …

User Experience

3 min read

If you want UX inspiration, eat a banana
If you want UX inspiration, eat a banana
User Experience

3 min read


May 1, 2020

5 ways that will change how you write React hooks

NOTE! Tips and methods in this post are my own personal preference, and I’m sure many people will disagree. There is no right or wrong. Every approach has its pros and cons. If you take just one good thing out of the post — I’ve done my share. I do…

Reactjs

4 min read

5 ways that will change how you write React hooks
5 ways that will change how you write React hooks
Reactjs

4 min read


Feb 27, 2019

Redux Bad Practices — 6 part series

I wrote 6 short articles about better ways to write your Redux code. Hope you find it useful! https://medium.com/@adamklein_66511/redux-bad-practices-1-lists-as-arrays-9115ba87b0ce https://medium.com/@adamklein_66511/redux-bad-practices-2-duplicate-code-9f2f3d774d4d https://medium.com/@adamklein_66511/redux-bad-practices-3-nested-state-6eebf1a410df https://medium.com/@adamklein_66511/redux-bad-practices-5-duplicate-state-996d259758e3

JavaScript

1 min read

JavaScript

1 min read


Feb 27, 2019

Redux Bad Practices #6: Mix UI State with Model Data

In a Redux store, you may have both data from the server, together with the UI-related state. For example, you can have a list of products from the server, and save which one of those the user has selected using a checkbox. One approach is to store the UI-related state…

React

1 min read

React

1 min read


Feb 27, 2019

Redux Bad Practices #5: New Objects On The Fly

Consider the following code: mapStateToProps = (state) => ({ currentUser: { id: state.currentUserId, role: state.currentRole } }) The example above will always return a new object for currentUser and will force the component to re-render. The same idea applies to returning a new array (e.g. …

JavaScript

2 min read

JavaScript

2 min read


Feb 27, 2019

Redux Bad Practices #4: Duplicate State

Let’s say you need to display a filtered list of products. One approach would be to save the filtered list on each filter change in a component’s state or in a different key in a Redux store: onFilterChange(filter) { this.setState({ filteredProducts: this.props.products.filter(...) }) } A better approach would be to…

React

1 min read

React

1 min read


Feb 27, 2019

Redux Bad Practices #3: Nested State

Complex applications usually deal with data structures that have associations, e.g. posts that have comments. You might save the data nested in the state: posts: id: 1 title: 'Better Redux' comments: id: 2 text: 'Great article!' But a better approach would be to flatten the state and operate with foreign…

JavaScript

1 min read

JavaScript

1 min read


Feb 27, 2019

Redux Bad Practices #2: Duplicate Code

Many applications have repeating functionality for different reducers with minor changes. For example, many forms that have view and edit modes. One approach would be to duplicate the reducer code: function userFormReducer(state, action) { switch (action.type) { case SET_USER_VIEW_MODE: return { ...state, viewMode: action.payload.viewMode }; ... } } function jobFormReducer(state…

Redux

1 min read

Redux

1 min read

Adam Klein

Adam Klein

83 Followers

http://adamklein.dev/ I write code, and speak about it

Following
  • Tom Teman

    Tom Teman

  • Liran Jakob Rosenfeld

    Liran Jakob Rosenfeld

  • Evgeny

    Evgeny

  • Tair Malka

    Tair Malka

  • Racheli Kogan

    Racheli Kogan

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech