Giter VIP home page Giter VIP logo

chrjs.store's People

Contributors

bengillies avatar jdlrobson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chrjs.store's Issues

General Idea

Hi Ben,
I like this approach.
But wouldn't it be better to have a TiddlyWeb library, and on top of it, build a TiddlySpace specific AddOn, Plugin or such?

I think the other way around will be much more difficult.
-m

Bad LocalStorage

It is possible to break the chrjs.store by adding something to localStorage that it doesn't expect.
For instance an external app might run the following javascript
localStorage.setItem("foo", "bar")

Expected:
Anything in a bad form should be ignored.

Actual:
Currently this can cause errors as "bar" might be attempted to be parsed as json.

Feature request: Filter dirty tiddlers

I currently have a page for adding/editing tiddlers in the private bag on TiddlySpace and one for the public bag.
In the private page, I want to be able to see how many private tiddlers need syncing, and likewise in the public bag.
Currently creating a store and retrieving from cache and running dirty() gives me a list of all the dirty tiddlers.

Any ideas for how I could do this in a nice way?
Currently I must resort to getting tiddlers and looping through them checking their bags!

Successful save doesn't clean store

Sorry I couldn't get tests working in a dev copy of chrjs store, but essentially this test describes the problem where a put to "/bags/bag/tiddlers/bar dum" results in a success.
The last assertion fails.

test("chrjs-store", function() {
    var tid = new tiddlyweb.Tiddler("bar dum", new tiddlyweb.Bag("bag", "/"));
    var s = new tiddlyweb.Store();
    strictEqual(s().dirty().length, 0, "have clean store");
    s.add(tid);
    strictEqual(s().dirty().length, 1, "have dirty store");
    s.save(tid, function() {

    }, function() {

    });
    strictEqual(s().dirty().length, 0, "successful save results in clean store");
});

Please provide xhr in save/delete callbacks

Access to the xhrs would be useful for determining the difference between a timeout because I'm offline and a 404/501 etc error.
Currently the callback only provides the tiddler and an error message.

from localStorage helper function

given a tiddler that has been retrieved via store.get
is there anyway to see if it came from the store?

    store.get(note, function(tid) {
        if(tid.fromCache()) {
            // do something
        }
    });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.