0.0.6 • Published 2 years ago

jcontrol v0.0.6

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

jControl

Super simple JS controller.

Installation

npm install jcontrol --save-dev

Application

Application is the main class for bootstrapping. Controllers are registered on an application instance. For registering glob of controllers please refer to your bundler's documentation.

import { Application } from "jcontrol";
import Search from "./controllers/search";

const application = new Application();

application.register("search", Search);

application.run();

Controllers

Controllers are instances of classes that you register in your application. Each controller class inherits from the Controller base class.

<div data-controller="search">
    
</div>
import { Controller } from "jcontrol";

export default class extends Controller {

    created() {
        //        
    }

    connected() {
        //
    }

    disconnected() {
        //
    }
}

Controller classes are templated so more specific elements can be used if needed.

import { Controller } from "jcontrol";

export default class extends Controller<HTMLElement> {
    //
}
0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago