Skip to content

Way to disable the store #185

@avandecreme

Description

@avandecreme

In my use case, I am creating and destroying a lot of canvases.
However, every time I call Caman on one of them, it get cached and thus never released by the GC.

Is there a clean way to disable the store?

This is how I am doing it right now:

                var camanNoStore = function(canvas, callback) {
                    var storePutBackup = Caman.Store.put;
                    Caman.Store.put = function() {};
                    /* jshint newcap: false */
                    Caman(canvas, function() {
                        callback.bind(this)();
                    });
                    Caman.Store.put = storePutBackup;
                };

I can then call camanNoStore as I would call Caman.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions