1.0.5 • Published 3 years ago

attojs v1.0.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

attoJS

The smallest high preformance JS framework.

Features

tinyJS allows you to use multiple common disign patterns in your code, these include:

  • data hiding

  • function composition

  • lambda functios

Examples

  • data hiding (parameters)
$ = require("attojs")

let cat = (name)=>{return {meow: ()=>console.log(`${name} meows`)}}

let my_cat = $(cat,"bob")

// we dont have accses to the name data
my_cat.meow()
  • data hiding (state)
$ = require("attojs")

let id = $(()=>{
	let id = 0
	return {
		getid: ()=>(id++)
	}
})

// this will print 0
console.log(id.getid());
// this will print 1
console.log(id.getid());

// we dont have acces to the inner state of id
  • function composition
$ = require("attojs")

function makelog(id) {
	return `this is log ${id}`
}

let logid = (id)=>console.log(makelog(id))

$(logid,1)
  • lambda functios
((x) => {x + 1})(1) // 2
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago