0.2.46 • Published 1 month ago

@vandeurenglenn/lite v0.2.46

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

lite

install

npm i @vandeurenglenn/lite

usage

import { LiteElement, property, query, state, html, css, customElement } from '@vandeurenglenn/lite'
@customElement('some-element')
class SomeElement extends LiteElement {
  @property()
  accessor items = ['hello', 'world']

  render() {
    return html`${this.items.map((item) => html`${item}`)}`
  }
}

provides/consumes

basic data binding using pubsub

consumes

import { LiteElement, property, html, customElement } from '@vandeurenglenn/lite'
@customElement
class ConsumerEl extends LiteElement {
  @property({ consumes: true, type: Array })
  accessor items

  @property({ consumes: 'someunique-id', type: Boolean })
  accessor drawerOpen

  render() {
    return html`${this.items.map((item) => html`${item}`)}`
  }
}

provides

import { LiteElement, property, customElement } from '@vandeurenglenn/lite'
@customElement
class ProviderEl extends LiteElement {
  @property({ provides: true })
  accessor items = ['hello', 'world']

  @property({ provides: 'someunique-id', type: Boolean })
  accessor drawerOpen = false
}

onChange

import { LiteElement, property, customElement } from '@vandeurenglenn/lite'
@customElement
class ProviderEl extends LiteElement {
  @property({ type: Boolean })
  accessor drawerOpen = false

  // runs after render
  onChange(propertyKey, value) {}
}

willChange

import { LiteElement, property, customElement } from '@vandeurenglenn/lite'
@customElement
class ProviderEl extends LiteElement {
  @property({ type: Boolean })
  accessor drawerOpen = false

  // runs before render
  willChange(propertyKey, value) {
    return value // always return
  }
}
0.2.46

1 month ago

0.2.45

1 month ago

0.2.44

2 months ago

0.2.41

2 months ago

0.2.40

2 months ago

0.2.43

2 months ago

0.2.42

2 months ago

0.2.39

2 months ago

0.2.38

2 months ago

0.2.37

2 months ago

0.2.36

2 months ago

0.2.35

3 months ago

0.2.34

3 months ago

0.2.33

3 months ago

0.2.32

3 months ago

0.2.27

3 months ago

0.2.26

3 months ago

0.2.30

3 months ago

0.2.31

3 months ago

0.2.29

3 months ago

0.2.28

3 months ago

0.2.25

3 months ago

0.2.24

3 months ago

0.2.23

3 months ago

0.2.22

3 months ago

0.2.21

3 months ago

0.2.20

4 months ago

0.2.19

4 months ago

0.2.18

4 months ago

0.2.17

4 months ago

0.2.16

4 months ago

0.2.15

4 months ago

0.2.14

4 months ago

0.2.13

4 months ago

0.2.12

4 months ago

0.2.11

4 months ago

0.2.10

4 months ago

0.2.9

4 months ago

0.2.8

4 months ago

0.2.7

4 months ago

0.2.6

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.1

4 months ago

0.2.3

4 months ago

0.2.2

4 months ago

0.2.5

4 months ago

0.2.4

4 months ago

0.1.0

4 months ago