Skip to content

Instantly share code, notes, and snippets.

@oomusou
Created February 8, 2019 08:47
Show Gist options
  • Save oomusou/8816f849008d7a77fc1d3b3b3c75fcda to your computer and use it in GitHub Desktop.
Save oomusou/8816f849008d7a77fc1d3b3b3c75fcda to your computer and use it in GitHub Desktop.
<template>
<div>
<ul>
<li v-for="(item, index) in books$" :key="index">
Title : {{ item.title }}, Price : {{ item.price }}
</li>
</ul>
</div>
</template>
<script>
import { fetchBooks } from '@/api/books';
import { pluck } from 'rxjs/operators';
const books$ = fetchBooks().pipe(
pluck('data', 'books'),
);
export default {
name: 'HelloWorld',
subscriptions: () => ({
books$
}),
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment