Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add freeze option #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ new Vue({
// Optionally we can watch the parameters for changes in nested
// objects using the 'deep' option
deep: true,
// Optionally we can decide whether to freeze data
// using the 'freeze' option
freeze: true,
//// Meteor Reactivity
// This will be refresh each time above params changes from Vue
// Then it calls Tracker.autorun() to refresh the result
Expand Down
2 changes: 1 addition & 1 deletion src/vue-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
if (result && typeof result.fetch === 'function') {
result = result.fetch();
}
if(Vue.config.meteor.freeze) {
if(options.freeze === true || Vue.config.meteor.freeze && options.freeze === undefined) {
result = Object.freeze(result);
}
this[key] = result;
Expand Down