on(event, callback, context)

Listen to changes in Mimic data, for a list of events please see Events.

import Mimic from 'mimic';

// without context
Mimic.on('REQUEST_CAPTURED', () => console.log('a request has been captured')); 
// outputs: a request has been captured

// with context
const context = { foo: 'bar' };
Mimic.on('REQUEST_CAPTURED', () => console.log(this.foo), context); 
// outputs: bar