Skip to content

Conversation

@ngokevin
Copy link
Member

@ngokevin ngokevin commented Aug 8, 2017

Description:

Don't pass data/oldData into the component events, only the component signature (a one time allocation). Leave it up to the application to fetch the old/current data if needed.

Changes proposed:

  • Save an object allocation every componentchanged (i.e., every component instance, every 200ms).
  • Save two object allocations every componentinitialized (including the getData clone).

newData: self.data,
oldData: oldData
}, false);
this.signature = {id: this.id, name: this.name};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is evtDetail a better name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@ngokevin ngokevin force-pushed the optimizecompevent branch from 6bd88b8 to 4050d0d Compare August 8, 2017 21:49
oldData: oldData
}, false);
this.throttledEmitComponentChanged = utils.throttle(function emitChange () {
el.emit('componentchanged', self.evtDetail, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not passing oldData anymore as detail?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same for newData?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think applications can fetch that themselves if needed? I suppose we could update the object without harm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants