Open justinbmeyer opened 5 years ago
function paginate(limit) {
const [ count, setCount ] = useState();
return {
next(){ ... },
prev(){ ... },
get page(){ ... }
}
}
createContext
/ useContext
first is probably a good idea.SearchResults
... Should this inherit from Array? Then you get a lot for free.Object.assign()
be nicer in SearchResult::constructor
?Could your models call useState
?
class Todo {
static todosById = {};
static get(id){
const [ todo, setTodo ] = useState();
}
}
function EditTodo(){
const [todo, setQuery]
}
General Guidelines