Expand my Community achievements bar.

SOLVED

Best place to connect Shared Model

Avatar

Level 3
I am working with a simple Shared Model which implements
ISessionSubscriber. I noticed that some of the examples set up
their Shared Models upon creationComplete of one of the view
components inside ConnectSessionContainer.



Is this the recommended approach? Would it be better (or as
efficient) to listen to the synchronizationChange Event of
ConnectSessionContainer and use that as a trigger to build the
Shared Model?



Just looking for guidance, the flow of an AFCS app is still
quite new to me.



thanks



Stefan
1 Accepted Solution

Avatar

Correct answer by
Level 3
Yes that helps, thank you.

View solution in original post

2 Replies

Avatar

Former Community Member
Hi ,



If you look inside the onSynchronizationChange function in
ConnectSessionContainer, we build its children when session is
synchronized and then dispatch the event. So, you can either use
the creationComplete of the ConnectSessionConatainer or the
synchronizationChange event fired from it to build your
sharedModel.

Just make sure if you are listening to the
synchronizationChange event, check that the session is
synchronizated before building your model



Hope this helps.



Thanks

Hironmay Basu

Avatar

Correct answer by
Level 3
Yes that helps, thank you.