Files
habitica/website/client/store/state.js
Matteo Pagliazzi 20792f5455 New Client: stable (#8426)
* try to freeze content object

* deep freeze the content object, start to implement stable

* freeze at the /common level

* go back to freezing content only on the client

* use deep-frezze-strict to support phantomjs

* use own version of deepFreeze

* update comment about deepFreeze
2017-02-15 12:49:57 +01:00

14 lines
489 B
JavaScript

import deepFreeze from '../libs/deepFreeze';
import content from '../../common/script/content/index';
const state = {
title: 'Habitica',
user: null,
tasks: null, // user tasks
// content data, frozen to prevent Vue from modifying it since it's static data that never changes
// TODO apply freezing to the entire codebase (the server) and not only to the client side?
// NOTE this takes about 10-15ms on a fast computer
content: deepFreeze(content),
};
export default state;