Replace access with lodash.get, make more declarative.
Lodash already has support for safe property access via the explicit `get` method, and as a shorthand to many of the collection methods (such as `sortBy`. I also took this opportunity to refactor the code to be a bit more functional, which allows us to place the list tiems inline with the rest of the JSX, which I find far more readable. Interesting project!
This commit is contained in:
parent
5f52e0b75e
commit
df2c7ef323
2 changed files with 18 additions and 23 deletions
|
|
@ -15,7 +15,6 @@
|
|||
"react-helmet": "^3.2.2",
|
||||
"react-responsive-grid": "^0.3.3",
|
||||
"react-typography": "^0.15.0",
|
||||
"safe-access": "^0.1.0",
|
||||
"typography": "^0.15.0",
|
||||
"typography-theme-wordpress-2016": "^0.15.0",
|
||||
"underscore.string": "^3.2.3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue