0.0.17 • Published 5 years ago

@dot-event/controller v0.0.17

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@dot-event/controller

dot-event dom controllers

controller

Install

npm install dot-event @dot-event/controller

Setup

const dot = require("dot-event")()
require("@dot-event/controller")(dot)

Usage

First create your controller composer:

module.exports = function(dot) {
  dot.controller("myController", myController)
}

async function myController() {
  // control stuff
}

Then use it:

require("./myController")(dot)
dot.myController()

Props

Commonly we append the controller name to the prop array and pass the concatenated props to sub-events.

Passing those props down produces descriptive element ids and logs that describe the call stack.

Luckily, the controller composer injects the controller name into the prop array automatically, eliminating the controller name append step.

ℹ️ Prop injection is the only thing the controller composer does at this point in time.

Related composers

LibraryDescriptionURL
elDOM elementshttps://github.com/dot-event/el#readme
renderServer side renderhttps://github.com/dot-event/render#readme
viewDOM viewshttps://github.com/dot-event/view#readme
0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago