:ghost: Tiny React like framework with Concurrent.
+
:ghost: Tiny Coroutine framework with Fiber.
@@ -9,17 +9,12 @@
-### Feature
-- :tada: Functional Component and hooks API
-- :confetti_ball: Time slicing and Algebraic effects
-- :telescope: keyed reconcilation algorithm
+- **Coroutine with Fiber** — This is an amazing idea, which implements the coroutine scheduler in JavaScript, and the rendering is asynchronous, which supports Time slicing and suspense components.
-### Real world
+- **Highly-optimized algorithm** — Fre has a better reconciliation algorithm, which traverses from both ends with O (n) complexity, and supports keyed.
-[clicli.me](https://www.clicli.me)
-
-Any other demos [click here](https://github.com/yisar/fre/tree/master/demo/src)
+- **Do more with less** — After tree shaking, project of hello world is only 1KB, but it has most fetures, virtual DOM, hooks API, functional component and more.
### Use
@@ -59,8 +54,6 @@ render(, document.getElementById('root'))
- [useRef](https://github.com/yisar/fre#useref)
-- [useContext](https://github.com/yisar/fre#usecontext)
-
#### useState
`useState` is a base API, It will receive initial state and return a Array
@@ -102,7 +95,7 @@ function App() {
{state.count}
-
+
)
}
@@ -138,7 +131,7 @@ If it return a function, the function can do cleanups:
```js
useEffect(() => {
document.title = 'count is ' + count
- reutn () => {
+ return () => {
store.unsubscribe()
}
}, [])
@@ -146,7 +139,7 @@ useEffect(() => {
#### useLayout
-More like useEffect, but useEffect queue in `requestAnimationFrame`, but useLayout is sync and block commitWork.
+More like useEffect, but useLayout is sync and blocking UI.
```js
useLayout(() => {
@@ -156,7 +149,7 @@ useLayout(() => {
#### useMemo
-`useMemo` has the same parameters as `useEffect`, but `useMemo` will return a cached value.
+`useMemo` has the same rules as `useEffect`, but `useMemo` will return a cached value.
```js
function App() {
@@ -234,19 +227,5 @@ The above code needs babel plugin `@babel/plugin-transform-react-jsx`
]
```
-#### time slicing
-
-Time slicing is the scheduling of reconcilation, synchronous tasks, sacrifice CPU and reduce blocking time
-
-#### resumable exception
-
-resumable exception is a concept of algebraic effects. It can synchronously throw effects and then resume the execution of other logic of components.
-
-#### key-based reconcilation
-
-Fre implements a compact reconcilation algorithm support keyed, which also called diff.
-
-It uses hash to mark locations to reduce much size.
-
#### License
_MIT @yisar
diff --git a/demo/index.html b/demo/index.html
index 85b1a17e..16b64b46 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -10,7 +10,7 @@
-
+