atomicojs / atomico

Atomico a micro-library for creating webcomponents using only functions, hooks and virtual-dom.
https://atomicojs.dev
MIT License
1.16k stars 43 forks source link

0.11 #14

Closed UpperCod closed 4 years ago

UpperCod commented 4 years ago

update

  1. Remove the HoCs support, removing the Ad HoC Router and Lazy support, to be replaced by hooks.
  2. simplify hook propagation
  3. improve the testing experience and encapsulate the error debug render
  4. unifies the elements and core folder

todo

rewrite the tests, which unify the core and element version

Example code

rendered

allows you to encapsulate the render in a promise associated with a unique process

try{
    await node.rendered;
}catch(e){
    //error
}

updates are grouped into a promise

use-state-generator

allows to observe asynchrony based on hooke and generators

import {useStateGenerator,delay} from "atomico/use-state-generator";

let [state]  = useStateGenerator(function *(){
    yield 1;
    yield delay(1000);
    return 2;
})