Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
firex-store
Advanced tools
If you use this npm, you can read and write firestore data, easily.
import { to, from, on, firestoreMutations } from 'firex-store'
import { firestore } from '~/plugins/firebase'
// Vuex module
export default {
state: {
comments: []
},
mutations: {
...firestoreMutations('collection'),
// ...firestoreMutations('all')
},
actions: {
subscribe: ({ state, commit }) => {
const ref = firestore.collection('comments')
from(ref)
.bindTo('comments')
.subscribe(state, commit, /* { mapper, errorHandler, complectionHandler, afterMutationCalled } */)
},
unsubscribe: ({ state }) => {
on('comments').unsubscribe(state)
},
find: async (_, { commentId }) => {
const ref = firestore.collection('comments').doc('commentId')
result = await from(ref).once().find(/* { mapper, errorHandler, completionHandler } */)
return result
},
add: (_, { data }) => {
const ref = firestore.collection('comments')
return to(ref).add(data, /* { mapper, errorHandler, completionHandler } */)
},
set: (_, { data, commentId }) => {
const ref = firestore.collection('comments').doc('commentId')
return to(ref)
// .transaction() <- comment out if you use transaction
.set(data, /* { mapper, errorHandler, completionHandler } */)
},
mergeSet: (_, { data, commentId }) => {
const ref = firestore.collection('comments').doc('commentId')
return to(ref)
// .transaction() <- comment out if you use transaction
.mergeSet(data, /* { mapper, errorHandler, completionHandler } */)
},
delete: (_) => {
const ref = firestore.collection('comments').doc('commentId')
return to(ref)
// .transaction() <- comment out if you use transaction
.delete(/* { errorHandler, completionHandler } */)
}
}
}
npm install --save firex-store
others comming soon
Return values or state values bound to Firestore has docId
(documentId in Firestore) property.
A store module cannot subscribe to more than one 'collection' and 'document'
If you'd like to subscribe again after unsubscribing 'collection', set the property of the store you'd like to subscribe to []
and then subscribe.
FAQs
Subscribe and write firestore data, easily
We found that firex-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.