@@ -15,80 +15,23 @@ Install the latest version via NPM:
1515npm install @studiometa/js-toolkit
1616```
1717
18- ## Concept
18+ ## Documentation
1919
20- [ ] todo
20+ This project contains a JavaScript micro-framework and its utility functions whose main objectives are:
2121
22- ## Usage
22+ - Enforcing best-practice and consistency between projects
23+ - Using elements from the DOM easily
24+ - Enabling custom behaviours on component initialization or other user events
25+ - Disabling custom behaviours on component destruction or other user events
26+ - Initializing components in the right place at the right time
27+ - Defining dependencies between components
2328
24- Import the ` Base ` class and extend it to create your components:
29+ Visit [ js-toolkit.studiometa.dev ] ( https://js-toolkit.studiometa.dev ) to learn more.
2530
26- ``` js
27- import { Base , createApp } from ' @studiometa/js-toolkit' ;
31+ ## Contributing
2832
29- class Component extends Base {
30- static config = {
31- name: ' Component' ,
32- }
33+ This projects follows the [ Git Flow] ( https://github.com/petervanderdoes/gitflow-avh ) methodology to manage its branches and features. The packages and their dependencies are managed with NPM workspaces. The files are linted with ESLint, type checked with TypeScript and formatted with Prettier.
3334
34- sayHello () {
35- console .log (' Hello!' );
36- }
37- }
35+ ## License
3836
39- class App extends Base {
40- static config = {
41- name: ' App' ,
42- components: {
43- Component,
44- },
45- refs: [' btn' , ' items[]' ],
46- options: {
47- foo: String ,
48- bar: { type: String , default: ' bar' },
49- }
50- };
51-
52- mounted () {
53- this .$log (' mounted' );
54-
55- // Options
56- this .$options .name ; // 'App'
57- this .$options .log ; // true
58- this .$options .debug ; // false
59- this .$options .foo // ''
60- this .$options .bar // 'bar'
61-
62- // Children
63- this .$children .Component ; // Array<Component>
64-
65- // DOM references
66- this .$refs .btn ; // <button data-ref="btn"></button>
67- this .$refs .items [0 ]; // <li data-ref="items[]"></li>
68- }
69-
70- destroyed () {
71- this .$log (' destroyed' );
72- }
73-
74- scrolled (props ) {
75- this .$log (' scrolled' , props);
76- }
77-
78- resized (props ) {
79- this .$log (' resized' , props);
80- }
81- }
82-
83- export default createApp (App, document .body );
84- ```
85-
86- Read the [ documentation] ( https://js-toolkit.studiometa.dev/ ) to learn more.
87-
88- ## Contribution
89-
90- This projects follows the [ Git Flow] ( https://github.com/petervanderdoes/gitflow-avh ) methodology to manage its branches and features.
91-
92- The packages from this project are managed with NPM workspaces.
93-
94- The files are linted with ESLint, type checked with TypeScript and formatted with Prettier.
37+ See [ LICENSE] ( ./LICENSE ) .
0 commit comments