Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add present object to params and use sendEvent #3

Merged
merged 8 commits into from
Apr 21, 2017

Conversation

offirgolan
Copy link
Owner

@poteto since I was passive aggressively asked not to commit to master... 馃槄

This PR has a couple of things:

  • Setup dummy app with an example to use + setup changelog + release
  • Initial readme setup (just the skeleton of it, nothing else really)
  • Add the present param to the passed args so you can quickly gage if there have been changes from the defaults. This sort of goes into how or if we wanna manage some sort of state object. For example, keep an object on the controller such as qParams.sortDirection.hasChanged or qParams.hasChanged.
  • Use sendEvent so we can use Ember.on
onQueryParamsDidChange: Ember.on('queryParamsDidChange', function({ changes, queryParams, routeName }) {
  this.get('metrics').trackEvent(assign({
    event: 'Query Params Changed',
    routeName,
  }, queryParams))
})

I really like this because you can now tap into this 'event' from a mixin, extends, or even an initializer to do something send over metrics via google analytics.

@offirgolan offirgolan mentioned this pull request Apr 21, 2017
Closed
@offirgolan offirgolan merged commit 2b4cea5 into master Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant