https://github.com/souenzzo/vlop
value oriented programming utilities for javascript
https://github.com/souenzzo/vlop
data-driven functional immutable javascript
Last synced: 11 months ago
JSON representation
value oriented programming utilities for javascript
- Host: GitHub
- URL: https://github.com/souenzzo/vlop
- Owner: souenzzo
- Created: 2018-03-23T03:23:35.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-01-19T16:07:43.000Z (about 1 year ago)
- Last Synced: 2025-03-28T10:47:16.241Z (12 months ago)
- Topics: data-driven, functional, immutable, javascript
- Language: JavaScript
- Size: 137 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vlop
> Value-Oriented programming utilities for javascript.
## what?
It's just a functional/immutable javascript libraries.
It uses only the native (mutable) objects, but offers a collection of functions to operate the data without mutating
checkout this presentation: [Value-Values](https://www.infoq.com/presentations/Value-Values)
## examples
Apply a function in a collection of values
```javascript
import * as vlop from "@souenzzo/vlop"
const update_winners = (users) => (
vlop.map(user => vlop.update(user, "score", vlop.fnil(inc, 0)), users)
)
```
```javascript
> update_winners([{name: "Alice", score: 42}, {name: "Bob"}])
[ { name: 'Alice', score: 42 }, { name: 'Bob', score: 1 } ]
```
## developing
### Testing
```shell
## Install deps
npm ci
## Run tests
npm test
```