Lo que realmente almacena WinJS.Application.sessionState

In my Windows Store App I store data directly in the sessionState object so I don't need to move data there later on. In one case I store an object that has accessor methods for variables that are declared in the containing scope like so:

(function ()
    var a = [];
    var index = -1;

    WinJS.Application.sessionState.data = 
        add: function (item)
            index = a.length;
        currentItem: function ()
            return a[index];

My question is if the sessionState object will store a y index since they're scope referenced or not since they're are not really in it.

preguntado el 04 de diciembre de 12 a las 04:12

1 Respuestas

You can use "data" to manipulate "a" and "index" until the first time your app was suspended. Any data stored in the sessionState object is automatically serialized to disk when your app is suspended. Functions will be removed. After resuming, we lost 2 functions "add" and "currentItem".

Ver más: http://msdn.microsoft.com/en-us/library/windows/apps/hh440965.aspx

Respondido el 04 de diciembre de 12 a las 05:12

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.