Skip to content

Instantly share code, notes, and snippets.

@SeanRoberts
Created September 30, 2015 18:22
Show Gist options
  • Save SeanRoberts/6e64a1ca161218a74cc1 to your computer and use it in GitHub Desktop.
Save SeanRoberts/6e64a1ca161218a74cc1 to your computer and use it in GitHub Desktop.
_subscribeToEvents: ->
PubSub.subscribe 'mailChimp:loading', (e) ->
@setState(loading: true) if e.submitter == this
PubSub.subscribe 'mailChimp:done', (e) ->
@setState(loading: false) if e.submitter == this
PubSub.subscribe 'mailChimp:success', (e) ->
@setState(successMsg: e.msg, errorMsg: null) if e.submitter == this
PubSub.subscribe 'mailChimp:error', (e) ->
@setState(errorMsg: e.msg, successMsg: null) if e.submitter == this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment