import React from "react"
import { createList } from "@corets/list"
import { useList } from "@corets/use-list"
const globalList = createList(["apple", "oranges"])
const Example = () => {
const list1 = useList(["apples", "oranges"])
const list2 = useList(() => createList(["apples", "oranges"]))
const list3 = useList(globalList)
// alternative syntax
const [list, setList] = useList(globalList).use()
const addItem = () => list1.add("tomatoes")
return (
<div>
<button onClick={addItem}>Items: {list1.get().join(",")}</button>
</div>
)
}