1.0.8 • Published 1 year ago

moon-hooks v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago