firex-store
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -1,2 +0,2 @@ | ||
export { firestoreSubscribeActions } from './subscribe-action'; | ||
export { firestoreUnsubscribeActions } from './unsibscribe-action'; | ||
export { firestoreSubscribeActions, firestoreSubscribeAction } from './subscribe-action'; | ||
export { firestoreUnsubscribeActions, firestoreUnsubscribeAction } from './unsibscribe-action'; |
@@ -5,3 +5,5 @@ "use strict"; | ||
exports.firestoreSubscribeActions = subscribe_action_1.firestoreSubscribeActions; | ||
exports.firestoreSubscribeAction = subscribe_action_1.firestoreSubscribeAction; | ||
var unsibscribe_action_1 = require("./unsibscribe-action"); | ||
exports.firestoreUnsubscribeActions = unsibscribe_action_1.firestoreUnsubscribeActions; | ||
exports.firestoreUnsubscribeAction = unsibscribe_action_1.firestoreUnsubscribeAction; |
@@ -10,2 +10,3 @@ import { ActionTree } from 'vuex'; | ||
/** | ||
* @warn It is deprecated. It will be removed at `^1.0.0~` | ||
* @description subscribe firestore data to state property | ||
@@ -23,2 +24,15 @@ * @param actionName custom action name. can undefined | ||
export declare const firestoreSubscribeActions: <T = any>({ ref, actionName, options }: Criteria<T>) => ActionTree<any, any>; | ||
/** | ||
* @description subscribe firestore data to state property | ||
* @param actionName custom action name. can undefined | ||
* @param ref firebase.firestore.DocumentReference | firebase.firestore.CollectionReference | firebase.firestore.Query | ||
* @param options optional methods. can undefined | ||
* - mapper | ||
* - errorHandler | ||
* - completionHandler | ||
* - notFoundHandler | ||
* - afterMutationCalled | ||
* - onCompleted `deprecated` | ||
*/ | ||
export declare const firestoreSubscribeAction: <T = any>({ ref, actionName, options }: Criteria<T>) => ActionTree<any, any>; | ||
export {}; |
@@ -6,2 +6,3 @@ "use strict"; | ||
/** | ||
* @warn It is deprecated. It will be removed at `^1.0.0~` | ||
* @description subscribe firestore data to state property | ||
@@ -30,1 +31,25 @@ * @param actionName custom action name. can undefined | ||
}; | ||
/** | ||
* @description subscribe firestore data to state property | ||
* @param actionName custom action name. can undefined | ||
* @param ref firebase.firestore.DocumentReference | firebase.firestore.CollectionReference | firebase.firestore.Query | ||
* @param options optional methods. can undefined | ||
* - mapper | ||
* - errorHandler | ||
* - completionHandler | ||
* - notFoundHandler | ||
* - afterMutationCalled | ||
* - onCompleted `deprecated` | ||
*/ | ||
exports.firestoreSubscribeAction = ({ ref, actionName, options }) => { | ||
const defaultActionName = helpers_1.isDocumentRef(ref) | ||
? action_1.actionTypes.document.SUBSCRIBE | ||
: action_1.actionTypes.collection.SUBSCRIBE; | ||
const action = actionName ? actionName : defaultActionName; | ||
const tree = { | ||
[action]({ state, commit }) { | ||
helpers_1.subscribeFirestore({ state, commit, ref, options }); | ||
} | ||
}; | ||
return tree; | ||
}; |
@@ -8,2 +8,3 @@ import { MutationType } from '../../types'; | ||
/** | ||
* @warn It is deprecated. It will be removed at `^1.0.0~` | ||
* @description unsubscribe firestore data | ||
@@ -14,2 +15,8 @@ * @param type 'document' | 'collection' | ||
export declare const firestoreUnsubscribeActions: ({ type, actionName }: Criteria) => ActionTree<any, any>; | ||
/** | ||
* @description unsubscribe firestore data | ||
* @param type 'document' | 'collection' | ||
* @param actionName can undefined. But if you define actionName in `firestoreSubscribeAction`, set same name. | ||
*/ | ||
export declare const firestoreUnsubscribeAction: ({ type, actionName }: Criteria) => ActionTree<any, any>; | ||
export {}; |
@@ -6,2 +6,3 @@ "use strict"; | ||
/** | ||
* @warn It is deprecated. It will be removed at `^1.0.0~` | ||
* @description unsubscribe firestore data | ||
@@ -23,1 +24,18 @@ * @param type 'document' | 'collection' | ||
}; | ||
/** | ||
* @description unsubscribe firestore data | ||
* @param type 'document' | 'collection' | ||
* @param actionName can undefined. But if you define actionName in `firestoreSubscribeAction`, set same name. | ||
*/ | ||
exports.firestoreUnsubscribeAction = ({ type, actionName }) => { | ||
const defaultActionName = type === 'document' | ||
? action_1.actionTypes.document.UNSUBSCRIBE | ||
: action_1.actionTypes.collection.UNSUBSCRIBE; | ||
const action = actionName ? actionName : defaultActionName; | ||
const tree = { | ||
[action]({ state }) { | ||
helpers_1.unsubscribeFirestore({ state, type }); | ||
} | ||
}; | ||
return tree; | ||
}; |
export { firestoreMutations } from './mutations'; | ||
export { firestoreSubscribeActions, firestoreUnsubscribeActions } from './actions'; | ||
export { firestoreSubscribeAction, firestoreSubscribeActions, firestoreUnsubscribeAction, firestoreUnsubscribeActions } from './actions'; | ||
export { subscribeFirestore, unsubscribeFirestore } from './helpers'; | ||
export { actionTypes } from './types/action'; | ||
export { mutationTypes } from './types/mutation'; |
@@ -6,3 +6,5 @@ "use strict"; | ||
var actions_1 = require("./actions"); | ||
exports.firestoreSubscribeAction = actions_1.firestoreSubscribeAction; | ||
exports.firestoreSubscribeActions = actions_1.firestoreSubscribeActions; | ||
exports.firestoreUnsubscribeAction = actions_1.firestoreUnsubscribeAction; | ||
exports.firestoreUnsubscribeActions = actions_1.firestoreUnsubscribeActions; | ||
@@ -9,0 +11,0 @@ var helpers_1 = require("./helpers"); |
{ | ||
"name": "firex-store", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "subscribe firebase data to vuex", | ||
@@ -17,5 +17,3 @@ "main": "./lib/index.js", | ||
"prepublishOnly": "npm test && npm run lint", | ||
"preversion": "npm run lint", | ||
"version": "npm run format && git add -A src", | ||
"postversion": "git push && git push --tags" | ||
"preversion": "npm run lint" | ||
}, | ||
@@ -22,0 +20,0 @@ "repository": { |
@@ -84,4 +84,4 @@ # firex-store | ||
#### part2. Add below actions to namespaced Store | ||
- method: `firestoreSubscribeActions` | ||
- method: `firestoreSubscribeAction` or `firestoreSubscribeActions` | ||
- `firestoreSubscribeActions` is deprecated. It will be removed at `^1.0.0~` | ||
- argments: | ||
@@ -108,3 +108,3 @@ | ||
actions: { | ||
...firestoreSubscribeActions({ ref: firestore.collection('/comments') }) | ||
...firestoreSubscribeAction({ ref: firestore.collection('/comments') }) | ||
} | ||
@@ -197,5 +197,6 @@ ..... | ||
#### part1. Add `firestoreUnsubscribeActions` in actions | ||
#### part1. Add `firestoreUnsubscribeAction` in actions | ||
- method: `firestoreUnsubscribeActions` | ||
- method: `firestoreUnsubscribeAction` or `firestoreUnsubscribeActions` | ||
- `firestoreUnsubscribeActions` is deprecated. It will be removed at `^1.0.0~` | ||
- argments: | ||
@@ -217,4 +218,4 @@ | ||
actions: { | ||
...firestoreSubscribeActions({ ref: firestore.collection('/comments') }), | ||
...firestoreUnsubscribeActions({ type: 'collection' }) | ||
...firestoreSubscribeAction({ ref: firestore.collection('/comments') }), | ||
...firestoreUnsubscribeAction({ type: 'collection' }) | ||
} | ||
@@ -221,0 +222,0 @@ ..... |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45828
830
431