Cristian Salcescu's Blog, page 18

June 10, 2020

Things on null and undefined that you should know

Null and undefined are the so-called nullish values.

Continue reading on Programming Essentials »

 •  0 comments  •  flag
Share on Twitter
Published on June 10, 2020 10:01

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…

Continue reading on Programming Essentials »

 •  0 comments  •  flag
Share on Twitter
Published on June 09, 2020 09:01

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...
 •  0 comments  •  flag
Share on Twitter
Published on June 07, 2020 02:03

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…

Continue reading on The Startup »

 •  0 comments  •  flag
Share on Twitter
Published on June 06, 2020 03:46

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.

Continue reading on Programming Essentials »

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2020 09:47

How to Have Encapsulation in JavaScript

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.

Classes

A new option for achieving encapsulation is to use the hash # symbol to declare a private variable inside a class. This f...

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2020 06:53

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.

 •  0 comments  •  flag
Share on Twitter
Published on May 18, 2020 03:28

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

Continue reading on Medium

 •  0 comments  •  flag
Share on Twitter
Published on May 18, 2020 00:54

May 13, 2020

Functional React, 2nd Edition

The 2nd Edition of Functional React is out.

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.
 •  0 comments  •  flag
Share on Twitter
Published on May 13, 2020 22:27

May 3, 2020

A few questions on functional components

A few Questions on Functional ComponentsPhoto by Kelvyn Ornettte Sol Marte on Unsplash

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...

 •  0 comments  •  flag
Share on Twitter
Published on May 03, 2020 00:38