Cristian Salcescu's Blog, page 18
June 10, 2020
Things on null and undefined that you should know
June 9, 2020
How to Make Currying more Readable
Currying is a functional programming technique for transformation a function with n parameters into a series of n functions each expecting…
June 7, 2020
Functional React, 2nd Edition
Quick start with React Hooks, Redux and MobX

If you want to learn how to build modern React applications using functional components and functional programming principles, this is the book for you.
React allows expressing the UI using functions. React Hooks enables stateful functional components.
Here are some of the things you will learn:
The core functional programming concepts with JavaScriptHow to create components using only functionsPresentations and container components patternsHow to use the...June 6, 2020
How to Make JavaScript a Better Functional Language by Removing Features
With each new version, JavaScript gets more and more features in the hope that the more features the language have, the better it is. I…
June 5, 2020
How to create Functional Components in React
Have you wondered how to create a component in React? To answer, it is as simple as creating a function returning an HTML-like syntax.
How to Have Encapsulation in JavaScript

Encapsulation is about data-hiding. That’s it, we have private data behind public methods working with that data.
The main idea is to expose as little as possible to the outside world. Minimizing the connections with the external environment reduces unexpected changes. What we can hide, we can change.
Let’s look at tow to achieve it.
ClassesA new option for achieving encapsulation is to use the hash # symbol to declare a private variable inside a class. This f...
May 18, 2020
I haven’t used such a library.
I havent used such a library. I think the best option you have right now to write a practical application in a functional style in JavaScript is to use React Hooks + Redux. Then you will either treat all objects as immutable or use a library like Immutable.Js.

Can we make currying more readable?
Currying is a functional programming technique for transformation a function with n parameters into n functions each taking expecting one
May 13, 2020
Functional React, 2nd Edition
If you want to learn how to build React applications, in a functional style this is the book for you.
React allows expressing the UI using functions.
React Hooks enables stateful functional components.
Redux does state management using functional principles. Reducers, selectors, action creators are pure functions.
We are going to explore Redux Thunk and Redux Observable as middleware options.
MobX makes state observable and turns components into observers.
Programming in a functional style means to use concepts such as pure functions, immutability, closures, higher-order functions, or currying.
May 3, 2020
A few questions on functional components

Have you wondered how to create a component in React? To answer, it is as simple as creating a function returning an HTML-like syntax.
import React from 'react';function Counter({n}) {return (
{n}
);
}export default Counter;
Now lets see what happened. Counter is a function that transforms a number into HTML. And if you look more carefully, Counter is a pure function. Thats right, the kind of function that...