Skip to content

Commit

Permalink
Merge pull request #3221 from ractivejs/autoshuffle
Browse files Browse the repository at this point in the history
Add support for auto shuffling at the iterative block level
  • Loading branch information
evs-chris committed Apr 4, 2018
2 parents ac57150 + fe32b73 commit 4a209b1
Show file tree
Hide file tree
Showing 21 changed files with 1,400 additions and 111 deletions.
1 change: 1 addition & 0 deletions src/model/Computation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class Computation extends Model {
this.signature = signature;

this.isReadonly = !this.signature.setter;
this.isComputed = true;

this.dependencies = [];

Expand Down
1 change: 1 addition & 0 deletions src/model/ComputationChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class ComputationChild extends Model {

this.isReadonly = !this.root.ractive.syncComputedChildren;
this.dirty = true;
this.isComputed = true;
}

get setRoot() {
Expand Down
2 changes: 2 additions & 0 deletions src/shared/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class ContextData extends Model {
getKeypath() {
return '@context.data';
}

rebound() {}
}

export default class Context {
Expand Down
8 changes: 8 additions & 0 deletions src/view/Fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ export default class Fragment {
this.context = next;
}

rebound(update) {
this.items.forEach(x => x.rebound(update));
if (update) {
if (this.rootModel) this.rootModel.applyValue(this.context.getKeypath(this.ractive.root));
if (this.pathModel) this.pathModel.applyValue(this.context.getKeypath());
}
}

render(target, occupants) {
if (this.rendered) throw new Error('Fragment is already rendered!');
this.rendered = true;
Expand Down
Loading

0 comments on commit 4a209b1

Please sign in to comment.