-
-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Real-time : interface between MM.action and real-time event #51
Comments
Hi @ClemDelp, first of all, let me acknowledge that a real-time synchronization is indeed a very cool feature and I am planning on adding some kind of firebase-based sync myself, sooner or later. Second, I am not sure whether broadcasting individual actions and re-playing them on all connected clients is the right way to go. When using firebase to maintain sync, I would try to persist the mind map state to the firebase, merging the incoming data with current design any time a subtree changes. Finally, I am not sure I completely understand your question. Are you looking for a way to listen for MM.Actions performed (in order to broadcast them), or do you seek help with re-playing them once the server notifies you? If the latter is the case, please see https://github.com/ondras/my-mind/blob/master/src/action.js for individual MM.Action.* constructor signatures. The main problem with Actions is that they always select/focus the item being manipulated, so they are not very good at re-playing history. |
Hi Ondras, Thank you for your fast answer, Yes it's the second case, i'm using Backbone and i have a collection of nodes. All the collection's models have an id-father attributes used to re-build the tree under my-mind format. Actually when a user manipulates the tree all actions are broadcasted to other users then the tree are completely reset and re-build with update data. Of course this solution is really bad for user experience. That i would like it's something like: For example for a new node: And i would like apply this methode to all other actions but i can find actually a function to select an item by its id. I don't know excatly where is the collection of nodes? In the localstorage? |
The map itself ( The catch is that individual items do not expose their IDs; to find an item by ID, you will have to call its Adding a |
Thank you, with this three functions i can now get the item by it ID : MM.Map.prototype.getItemById = function(id){ MM.getItemsCollection = function(){ MM.getNodesRecursive = function(nodes,json){ I will try now to connect my Backbone events to my_mind MM.action |
do not auto-update via firebase when in edit mode. fixes #57
Hello,
i would like put my-mind in real-time, i'm using socket io to broadcast updates, now i would like to interface the real-time event to my-mind actions:
MM.action.insertNewItem
MM.actiion.removeItem
MM.action.MoveItem
etc
for example for insert a new item i need the father item, how i can get the item with its id? i can add a node to the current item put if i want add a node to a specific item how i have to do?
thank you
The text was updated successfully, but these errors were encountered: