1.0.8 • Published 12 months ago

moon-hooks v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Moon Hooks

useList

import { useList } from "./useList";

const { list: persons, ...personsHandler } = useList([
  {
    name: "Sam",
    city: "shanghai",
  },
]);

personsHandler.update(
  (person) => person.name == "Sam",
  (person) => {
    person.name = "Lee";
  }
);

useListWithId

import { useListWithId } from "..";

const { list: persons, ...personsHandler } = useListWithId([
  {
    id: "user_123456",
    name: "Sam",
    city: "shanghai",
  },
]);

personsHandler.updateById("user_123456", (person) => {
  person.name = "Lee";
});
1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago