<commit_before># knockout.persist

A simple localstorage extender for the [knockout.js](https://github.com/SteveSanderson/knockout) project.

## Usage

This extender can be used as any other [knockout.js extender](http://knockoutjs.com/documentation/extenders.html). Include the javascript file, `knockout.persist.js`, in your script imports or script bundle.

To make an observable to persist it's value to the `localStorage`. Extend it with `persist`, the value for it is the key to store the observable in to:

    // Will automatically load the value if it exists in the localStorage
    this.persistedValue = ko.observable().extend({ persist: 'persistedValue' });

    // Will automatically load the array if it exists in the localStorage
    this.persistedArray = ko.observableArray().extend({ persist: 'persistedArray' });

## License

This project is licensed under the MIT license. For more info, go to http://opensource.org/licenses/MIT.<commit_msg>Some small changes to the readme<commit_after># knockout.persist

A simple persistance extender for the [knockout.js](https://github.com/SteveSanderson/knockout) project. At the moment uses only localStorage if it exists in the browser.

## Usage

This extender can be used as any other [knockout.js extender](http://knockoutjs.com/documentation/extenders.html). Include the javascript file, `knockout.persist.js`, in your script imports or script bundle.

To make an observable to persist it's value to the `localStorage`. Extend it with `persist`, the value for it is the key to store the observable in localStorage:

    // Will automatically load and save the value if it exists in the localStorage
    this.persistedValue = ko.observable().extend({ persist: 'persistedValue' });

    // Will automatically load and save the array if it exists in the localStorage
    this.persistedArray = ko.observableArray().extend({ persist: 'persistedArray' });

## License

This project is licensed under the MIT license. For more info, go to http://opensource.org/licenses/MIT.
{'fraction_non_alphanumeric': 0.08916256157635467, 'fraction_numerical': 0.0, 'mean_word_length': 4.474393530997305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1933228', 'n_tokens_mistral': 571, 'n_tokens_neox': 528, 'n_words': 232}