Lambda Bag
Introduction
Functional JavaScript utility library focused in performance, modularity, and functional pattern.
The idea of this project is a lightweight set of functions the will reduce the amount of code in your vanilla JS project
Basically you won't need any library or be attached to one framework instead of that this compile some partterns that are commonly used in different projects following the DRY approach focusing in functional programming
You'll have some parts of jQuery, loadash, angular, react and other libraries
Installation
npm install lambda-bag
Usage
Documentation
Browser API
This module creates an API for common Browser API using simplified and friendly syntax (Similar to JQuery). It can be combined with observers, functional operators & helpers included below
// Don't do this const view = documentconst modal = document if viewclassList viewclassList else viewclassList // Do thisconst view = const modal =
Functional Operators
const double = x * 2// Compose multiplication and sum in the respective order1234-10
Observers API
const AppState = State; // Initialize subjectconst firstSubject = data: 'value-1' ... // orconst secondSubject = other: 'value-2' { console } // Hydrate state with initial users.AppState;AppState;AppState; // Get application stateAppState // Update application state and remove observerAppStateAppState;
Helpers
const key = 'option'const value = 'param1'const params = 'param1 param2 param3'const switchAttrs = params // Toggle string value ' param2 param3'switchAttrslength <= 0 ? :
Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
License
Lambda Bag is MIT licensed.