0.0.11 • Published 3 years ago

tlojs v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

TLO.js (The Last One)

TLO.js is the last npm package that you'll have to install. With little to no sub dependencies The goal of this repo is to jam pack it full of handy functions, functionality, etc to get the job done.

Sub Libraries

Examples

Table Usage

const data = [
  { a: 1, b: 2},
  { a: -1, b: 3}
]

const table = new Table({ data })
table.sort(0, true)
const query = table.select('A:B')

const results = query.exec(Sum)

// Render the table
const renderer = new TableRenderer(table)
renderer.renderTo(document.getElementById('data'))

// Or load the table from a CSV
const csv = `
a,b,c
1,1,1
2,2,2
3,3,3
`;

const table = Table.load(CsvLoader, csv)

Dependency Injection Usage

@Injectable()
class A {
  getNumber() { return 1 }
}

@Injectable()
class B {
  constructor(public a: A) {

  }
}

const service = Injector.resolve<B>(B)

Event and Event Hub Usage

// Define the custom event
class TestEvent extends BaseEvent {
  name = 'Test'
}

// Create a new instance of the event
const ev = new TestEvent()

// Listen to the event
GlobalEventHub.register(TestEvent, (e) => console.log(e))

// Dispatch the event
ev.dispatch()
0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.3

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago