localbase icon indicating copy to clipboard operation
localbase copied to clipboard

Add support for reactivity

Open Rednas83 opened this issue 4 years ago • 0 comments

Good work on this library!

Do you also have plans for reactivity?

Something like (example from 'dexie' for the 'vue3' framework)

<template>
  <ul>
    <li v-for="friend in friends" :key="friend.id">
      {{ friend.name }}, {{ item.age }}
    </li>
  </ul>
</template>

<script>
  import { liveQuery } from "dexie";
  import { useObservable } from "@vueuse/rxjs";
  import { db } from "./db";

  export default {
    name: "FriendList",
    setup() {
      return {
        db,
        items: useObservable(
          liveQuery(() => db.friends.toArray())
        ),
      };
    },
  };
</script>

Rednas83 avatar Dec 29 '21 16:12 Rednas83