摘要:
As an alternate to useState, you could also use the useReducer hook that provides state and a dispatch method for triggering actions. In this lesson, 阅读全文
摘要:
A pointed functor is a functor with an of method What's important here is the ability to drop any value in our type and start mapping away. The benifi 阅读全文
摘要:
We will see a peculiar example of a pure function. This function contained a side-effect, but we dubbed it pure by wrapping its action in another func 阅读全文
摘要:
An introduction to concatting items via the formal Semi-group interface. Semi-groups are simply a type with a concat method that are associative. We d 阅读全文
摘要:
It is really important to understand function signature in functional programming. The the code example below: 'map' is pointfree version of any founc 阅读全文
摘要:
In the class version of this component, we had a method called safeSetState which would check whether the component was still mounted before trying to 阅读全文
摘要:
Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the e 阅读全文
摘要:
Thanks to react-testing-library our tests are free of implementation details, so when we refactor components to hooks we generally don't need to make 阅读全文
摘要:
Maybe has two types: Just / Nothing. Just() will just return the value that passed in. Nothing returns nothing... Just/ Nothing are both functors, the 阅读全文
摘要:
We refactor a function that uses try/catch to a single composed expression using Either. We then introduce the chain function to deal with nested Eith 阅读全文