A simple frontend framework for HTML
Installation
npm i feeel -S
Usage
See examples
folder
Why
I am playing with idea about how to make something similar to React, but what would really harness the power of TS, also, won't make you change the mindset from OOP to compoment based thinking.
Ideas:
- props and states are not contained in the objects inside the Component,
but are members of the Component class - however, they are defined with
decorators
@prop
and@state
(or@p
and@s
)
React problem
The problem of React is that it makes you shift your mindset from pure OO to component based thiking. As for me, I would like to have the simplicity of React html rendering, but to have also full access to OOP.
conventions
friend functions
Typescript lacks frend
functionality.
So if you want class Foo
to have a function
that is a friend for class Bar
, prepend it with __friendToBar__
. For example:
class Foo{
__friendToBar__myFunc(){}
}
class Bar{
foo:Foo;
constructor() {
// can use his function
this.foo.__friendToBar__myFunc();
}
}
class Selecta{
foo:Foo;
constructor() {
// should NOT use his function, although TS syntax does not forbid us from doing it
/*!!!*/this.foo.__friendToBar__myFunc();
}
}