Skip to content

Commit

Permalink
Bigger titles README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed May 31, 2019
1 parent 19d2145 commit b08da60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Tsfunct is a **T**ype**S**cript **funct**ional library made directly for TS with its static
typesystem in mind.

### Installation
## Installation

To install this package run either:

Expand All @@ -13,7 +13,7 @@ or if you use npm

`npm i @siegrift/tsfunct --save`

### Motivation
## Motivation

There are two big libraries which provide helper functions for JS/TS. These are
[lodash](https://github.com/lodash/lodash) and [ramda](https://github.com/ramda/ramda). Both of
Expand Down Expand Up @@ -46,21 +46,21 @@ There are many advantages of this helper:

Refer to documentation, source code and tests for more examples.

#### Chaining
## Chaining

Original idea was to support chaining same way as lodash `_.chain` works, however after reading
[this article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
describing the disadvantages of using this function, I decided to drop this idea.

#### Functional programming style
## Functional programming style

All of the functions in this library are written **imperatively** (e.g. `get(object, path)` compared
to traditional functional `get(path, object)`). I encourage you to use FP style, and you can easily
create small wrappers, which will [curry](https://lodash.com/docs/4.17.11#curry), and
[rearrange](https://lodash.com/docs/4.17.11#rearg) the arguments (however, your helper will need
fixed number arguments).

### Immutability
## Immutability

All functions in this library are **effectively immutable**. That means that if you use the helpers
according to their idiomatic usage, library is immutable. However, you are able to modify the
Expand All @@ -73,7 +73,7 @@ const mapped = map(original, (val: any) => (val.a = 3));
// 'original' will equal to [{ a: 3 }, { a: 3 }, { a: 3 }]
```

### API and documentation
## API and documentation

Documentation is automatically generated from source code and can be found at github pages
[here](https://siegrift.github.io/tsfunct/).
Expand Down
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ <h1> @siegrift/tsfunct</h1>
<h1 id="tsfunct-circleci">tsfunct <a href="https://circleci.com/gh/Siegrift/tsfunct"><img src="https://circleci.com/gh/Siegrift/tsfunct.svg?style=svg" alt="CircleCI"></a></h1>
<p>Tsfunct is a <strong>T**ype</strong>S<strong>cript **funct</strong>ional library made directly for TS with its static
typesystem in mind.</p>
<h3 id="installation">Installation</h3>
<h2 id="installation">Installation</h2>
<p>To install this package run either:</p>
<p><code>yarn add @siegrift/tsfunct</code></p>
<p>or if you use npm</p>
<p><code>npm i @siegrift/tsfunct --save</code> </p>
<h3 id="motivation">Motivation</h3>
<h2 id="motivation">Motivation</h2>
<p>There are two big libraries which provide helper functions for JS/TS. These are
<a href="https://github.com/lodash/lodash">lodash</a> and <a href="https://github.com/ramda/ramda">ramda</a>. Both of
these libraries are made for JS and the TS typings have been added only afterwards. Also, these
Expand All @@ -97,25 +97,25 @@ <h3 id="motivation">Motivation</h3>
<li>Handles arrays, optional and nullable values (even in intermediate objects)</li>
</ul>
<p>Refer to documentation, source code and tests for more examples.</p>
<h4 id="chaining">Chaining</h4>
<h2 id="chaining">Chaining</h2>
<p>Original idea was to support chaining same way as lodash <code>_.chain</code> works, however after reading
<a href="https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba">this article</a>
describing the disadvantages of using this function, I decided to drop this idea.</p>
<h4 id="functional-programming-style">Functional programming style</h4>
<h2 id="functional-programming-style">Functional programming style</h2>
<p>All of the functions in this library are written <strong>imperatively</strong> (e.g. <code>get(object, path)</code> compared
to traditional functional <code>get(path, object)</code>). I encourage you to use FP style, and you can easily
create small wrappers, which will <a href="https://lodash.com/docs/4.17.11#curry">curry</a>, and
<a href="https://lodash.com/docs/4.17.11#rearg">rearrange</a> the arguments (however, your helper will need
fixed number arguments).</p>
<h3 id="immutability">Immutability</h3>
<h2 id="immutability">Immutability</h2>
<p>All functions in this library are <strong>effectively immutable</strong>. That means that if you use the helpers
according to their idiomatic usage, library is immutable. However, you are able to modify the
original entity, for example, by using <code>map</code> helper this way:</p>
<pre><code class="language-javascript"><span class="hljs-keyword">const</span> original = [{ <span class="hljs-attr">a</span>: <span class="hljs-number">0</span> }, { <span class="hljs-attr">a</span>: <span class="hljs-number">1</span> }, { <span class="hljs-attr">a</span>: <span class="hljs-number">2</span> }];
<span class="hljs-keyword">const</span> mapped = map(original, (val: any) =&gt; (val.a = <span class="hljs-number">3</span>));
<span class="hljs-comment">// 'mapped' will equal to [3, 3, 3]</span>
<span class="hljs-comment">// 'original' will equal to [{ a: 3 }, { a: 3 }, { a: 3 }]</span></code></pre>
<h3 id="api-and-documentation">API and documentation</h3>
<h2 id="api-and-documentation">API and documentation</h2>
<p>Documentation is automatically generated from source code and can be found at github pages
<a href="https://siegrift.github.io/tsfunct/">here</a>.</p>
<p><em>You can read the list and sources of all helpers in the src/lib folder <a href="https://github.com/Siegrift/tsfunct/tree/master/src/lib">here</a>.</em></p>
Expand Down

0 comments on commit b08da60

Please sign in to comment.