omniscientjs / immstruct

Immutable data structures with history for top-to-bottom properties in component based libraries like React. Based on Immutable.js
374 stars 21 forks source link

New subscription system for reference cursors #59

Closed tomasd closed 9 years ago

tomasd commented 9 years ago

Reference cursors are now notified about the change also in case when something on the path to the reference is changed.

tomasd commented 9 years ago

Hi, I've got issues using reference cursors. They were not notified when immstruct root structure changed. Originally there was a map containing cursor paths and listeners for the path. I've changed it, so notification function is subscribed to all combinations of the path. Then uppon swap event no searching is needed and all relevant reference cursors are updated.

mikaelbr commented 9 years ago

Very cool. Thanks. I need to look over this some later today. Could you possibly remove the dist-commit and squash the commits?

tomasd commented 9 years ago

I've squashed it in https://github.com/omniscientjs/immstruct/pull/60

mikaelbr commented 9 years ago

Great, thanks.

Tip: You can squash and force push to a branch to update a pull request:

$ git rebase -i HEAD~3 # where 3 is the number of commits you want to include

Inside your editor (vim by default), do something like

pick someHash1 - Commit message 1
squash someHash2 - Commit message 2
squash someHash3 - Commit message 3

This will squash someHash2 and someHash3 to someHash1. Update commit message, and a new commit will be replayed on your local branch that's the combination of the three.

Then you can force push to your PR branch (this should be a feature branch, not master)

$ git push origin myPRBranch -f

This will update the PR.

(You should have a separate branch for the PR to easily be able to merge upstream branch)