These are chat archives for kopa-app/mithril-admin

1st
Feb 2016
Ondrej Brinkel
@der-On
Feb 01 2016 13:16
@StephanHoyer you there?
Stephan Hoyer
@StephanHoyer
Feb 01 2016 13:35
jup
Ondrej Brinkel
@der-On
Feb 01 2016 13:36
I want/need to add hooks to mithril-admin to intercept outgoing requests, incoming responses and parsing response data and would like to know your thoughts on the API.
what I currently have is:
var app = mithrilAdmin({
  beforeRequest: function (options, context) {
     // manipulate options here
  },
  afterResponse: function (response, context, originalResponse) {
    // manipulate response here
  },
  beforeParseResponseData(data, context) {
    // return manipulated response data here
  }
});
Stephan Hoyer
@StephanHoyer
Feb 01 2016 13:47
currently don't have the time to think this over
Ondrej Brinkel
@der-On
Feb 01 2016 13:47
gotta go now. Would be happy about get some feedback from you later.
cya
Stephan Hoyer
@StephanHoyer
Feb 01 2016 13:47
as you know I'm not a fan of too detailed customization
simply overwriting the whole request/response should work in most cases.
Ondrej Brinkel
@der-On
Feb 01 2016 14:18
yes one can still reuse the original method inside the override
Ondrej Brinkel
@der-On
Feb 01 2016 14:29
thx solved it using monkey patching and reusing original method
no API change was needed for this.
Stephan Hoyer
@StephanHoyer
Feb 01 2016 14:29
:clap:
Ondrej Brinkel
@der-On
Feb 01 2016 14:32
now I'm about to make the theming cstomizable