Closed CharlesOkwuagwu closed 9 years ago
I'm passing a callback to the SessionStateList
constructor. serialisedState
is a parameter passed to the callback. It is called from SessionStateList.js, with a JSON string.
still struggling to follow the logic :(
I wanted to make SessionStateList
have a save
method (for use by Session
), but I didn't want to pass the entire Store
interface through to the SessionStateList
constructor as it only really needed one method. Instead I pass in a callback that provides only the saving ability. It means the SessionStateList
constructor is only passed the minimum dependency it requires.
Perhaps it would be simpler if the SessionStateList
constructor is passed the Store
and the identity and calls store.putSession
itself.
I've changed this quite a lot in the latest version. It's much simpler now. Reopen if you're still having problems :)
Hi,
var sessionStateList = new SessionStateList((serialisedState) => { return store.putSession(toIdentity, serialisedState); });
you never initialize serialisedState prior to this call. I've been trying to figure out what exactly you are doing here?