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

Added support for jspm package manager #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

uelarn
Copy link

@uelarn uelarn commented Oct 11, 2015

Used in application with the Aurelia framework using jspm package manager with system.js module loader.

Application code written in Typescript.

Use case:

import {localStorageDB} from "localStorageDB";

const OPENTAGS = "OpenTags";

export interface IOpenTagsRow {
    ID: number,
    TagID: number
}

export class LocalstorServices {
    private _lsdb: localStorageDB;


    constructor() {
        this._lsdb = new localStorageDB("MyToolBoxStore", "localStorage");
        if (!this._lsdb.tableExists(OPENTAGS)) {
            this._lsdb.createTable(OPENTAGS, ["TagID"]);
            this._lsdb.commit();
        }

    }

    getAllTagTreeState(): IOpenTagsRow[] {
        return this._lsdb.queryAll(OPENTAGS) as IOpenTagsRow[];
    }

    deleteTagTreeState(tagid: number) {
        this._lsdb.deleteRows(OPENTAGS, { TagID: tagid });
        this._lsdb.commit();
    }

    addTagTreeState(tagid: number) {
        this._lsdb.insert(OPENTAGS, { TagID: tagid });
        this._lsdb.commit();
    }
}

return insert(table_name, validateData(table_name, data));
} else {
var ids = [];
for (var n = 0; n < result_ids.length; n++) {
Copy link
Contributor

@w35l3y w35l3y Apr 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing #68 here.

I didn't get the idea of having localstoragedb.js duplicated.
Is it really necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants