schtate
TypeScript icon, indicating that this package has built-in type declarations

0.0.28 • Public • Published

schtate

Functional Wrappers for State Management

This library offers algebraic data types for managing state.

Motivation

Don't worry, if you aren't familiar with algebraic data types, this library is designed to be easy to consume regardless of prior functional programming experience.

I think it's safe to say that arrays are the most heavily leaned upon data structure we have in JavaScript/Typescript. This is because the JS language was modified to include a rich API for arrays. This API is inspired heavily by functional programming. You can write pure functions that act on each item of your array (if there are any) and you get a new copy of the array with each one. Even when modeling data as an object, it's common to convert the object to an array to iterate over it. Schtate aims to make it as easy to work with other types of data as it is to work with arrays.

Do I need to know Functional Programming to use schtate?

Inheriting code that uses FP can be daunting, as it can look quite different from imperative code. Composing functions into pipelines is pretty convenient, but if you aren't used to seeing it, it can be daunting and hard to read.

Schtate is designed to be easy to read and write to anybody who is familiar with Arrays and Promises. It is unlikely to be a full replacement for functional programming libraries like fp-ts or ramda.

Documentation

State

Maybe

Bool

Either

Result

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.280latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.280
0.0.270
0.0.261
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.171
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i schtate

Weekly Downloads

2

Version

0.0.28

License

ISC

Unpacked Size

22.3 kB

Total Files

22

Last publish

Collaborators

  • schwartzworld