globalstate-hooks

import { useRestReducer } from "globalstate-hooks"

Usage no npm install needed!

<script type="module">
  import globalstateHooks from 'https://cdn.skypack.dev/globalstate-hooks';
</script>

README

GlobalState hooks

Usage

import { useRestReducer } from "globalstate-hooks"

type Pet = {
  name: string
  type: "dog" | "cat"
}

const [state, { index, create, update, read, del, clear, updatePartial }] = useRestReducer<Pet>({
  api: {
    domain: "http://localhost/",
    name: "pets"
  }
})

index()