Skip to content

Instantly share code, notes, and snippets.

View lukejpreston's full-sized avatar

Luke Preston lukejpreston

  • Trail
  • Kendal
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lukejpreston on github.
  • I am lukejpreston (https://keybase.io/lukejpreston) on keybase.
  • I have a public key ASDMqV99dupce8mO3nE8yrQFjhLsrfNg_lBUU-rZLiBXowo

To claim this, I am signing this object:

I am not talking about small things, like a button that when clicked changes it's state to disabled. I am talking about large pages, for example a form with validation that requires a valid username, password and once logged in it takes you to a seperate site
For a long time React was a great tool for all things UI. But it never had great state managment tools. If you try to purely use state it doesn't take long before your code is riddled with hacks and confusing code, then trying to keep track of this state is a nightmare.
Redux is a great tool for managing all things state. It isn't restricted to React, but I don't imagine you would use it elsewhere. You pretty much use it like so
const reducer = (state, action) => {
if (action.type === 'login') return login(action)
else if (action.type === 'logout') return logout(action)
}
@lukejpreston
lukejpreston / comment.md
Last active February 19, 2019 08:50
JS mentor things I commonly say

=> Sugar Syntax

Did you know?

const fn = (input) => {
  return output
}

// equiv .