mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-10 04:26:42 +00:00
Redefined Isomorphic
This commit is contained in:
parent
258b96023c
commit
d7493fa192
1 changed files with 11 additions and 1 deletions
12
readme.md
12
readme.md
|
|
@ -309,7 +309,17 @@ let Identity = v => ({ chain: transform => transform(v) })
|
||||||
|
|
||||||
## Isomorphic
|
## Isomorphic
|
||||||
|
|
||||||
> When the same code is shared between the client and the server.
|
> Two objects are Isomorphic is they satisfy the condition: `compose(to, from) == Identity` and `compose(from, to) == Identity`
|
||||||
|
|
||||||
|
```js
|
||||||
|
const toChars = [].join;
|
||||||
|
|
||||||
|
const fromChars = ''.split;
|
||||||
|
|
||||||
|
fromChars.call(toChars.call([1,2,3])) // [ '1,2,3' ]
|
||||||
|
|
||||||
|
toChars.call(fromChars.call([1,2,3])) // '1,2,3'
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue