An open API service indexing awesome lists of open source software.

https://github.com/elliothux/muse

⚡️ A light and ease-to-use front-end framework 🌪
https://github.com/elliothux/muse

front-end front-end-development observer two-way-databinding

Last synced: 26 days ago
JSON representation

⚡️ A light and ease-to-use front-end framework 🌪

Awesome Lists containing this project

README

        

# Muse

✨ A light-weight and fast front-end framework

* Supporting JSX
* Virtual DOM
* Two-way Data Binding
* Observable State
* State Management
* Directives
* Supporting HOC
* More Easy to Use Features...

## Project Plan

### Done
✔ First Render using Virtual DOM
✔ Diff and Patch Render
✔ Supporting Two-way Data Binding
✔ Observer State
✔ Computed Data
✔ Handle Events
✔ Supporting Directives

### Todo
* [ ] Components and Props
* [ ] Life Cycle Hooks
* [ ] Events Encapsulation
* [ ] Dependence Collection
* [ ] Supporting Watch
* [ ] More Efficient Diff Render

## Usage

### Run Example
`git clone https://github.com/HuQingyang/Muse && cd ./Muse`
`npm install`
`npm start`

### Example
```jsx harmony
import { Muse } from 'muse.js';

class App extends Muse {
state = {
name: 'Joe',
age: 22,
langs: [
'JavaScript',
'Python',
'Rust',
'Scala'
],
showHello: true
}

computed = {
isAgeOdd() {
return this.state.age % 2 !== 0
}
}

handleClick = () => {
this.state.age ++;
}

render() { return (


Hello!




My name is {this.state.name}.



I'm {this.state.age} years old
and it's an odd number.


And I can those programming languages:



  • {lang}


Click Me

)}
}

const app = new App();
app.renderTo(document.getElementById('root'));
```
See also [Example](https://github.com/HuQingyang/Muse/blob/master/example/index.js)