refactor: remove vue-rx dependency

This commit is contained in:
Andrew Bastin
2021-08-12 13:44:10 +05:30
parent 971b35a252
commit c273ded97d
24 changed files with 238 additions and 234 deletions

View File

@@ -91,21 +91,23 @@
</template>
<script>
import { defineComponent } from "@nuxtjs/composition-api"
import { currentUser$ } from "~/helpers/fb/auth"
import { useReadonlyStream } from "~/helpers/utils/composables"
import {
graphqlCollections$,
setGraphqlCollections,
appendGraphqlCollections,
} from "~/newstore/collections"
export default {
export default defineComponent({
props: {
show: Boolean,
},
subscriptions() {
setup() {
return {
collections: graphqlCollections$,
currentUser: currentUser$,
collections: useReadonlyStream(graphqlCollections$, []),
currentUser: useReadonlyStream(currentUser$, null),
}
},
computed: {
@@ -388,5 +390,5 @@ export default {
return Object.prototype.hasOwnProperty.call(item, "item")
},
},
}
})
</script>

View File

@@ -122,9 +122,12 @@
</template>
<script>
import { defineComponent } from "@nuxtjs/composition-api"
import clone from "lodash/clone"
import { useReadonlyStream } from "~/helpers/utils/composables"
import { graphqlCollections$, addGraphqlFolder } from "~/newstore/collections"
export default {
export default defineComponent({
props: {
// Whether to activate the ability to pick items (activates 'select' events)
savingMode: { type: Boolean, default: false },
@@ -133,6 +136,11 @@ export default {
// Whether to show the 'New' and 'Import/Export' actions
showCollActions: { type: Boolean, default: true },
},
setup() {
return {
collections: useReadonlyStream(graphqlCollections$, []),
}
},
data() {
return {
showModalAdd: false,
@@ -152,14 +160,9 @@ export default {
filterText: "",
}
},
subscriptions() {
return {
collections: graphqlCollections$,
}
},
computed: {
filteredCollections() {
const collections = this.collections
const collections = clone(this.collections)
if (!this.filterText) return collections
@@ -270,5 +273,5 @@ export default {
this.$data.editingRequestIndex = undefined
},
},
}
})
</script>