Advertisement
kelsos

monkeypatching

Jan 27th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         // matrix.once('sync', state => {
  2.         //   if (state === 'PREPARED') {
  3.         //     // @ts-ignore
  4.         //     const sync = matrix._syncApi._sync;
  5.         //     // @ts-ignore
  6.         //     matrix._syncApi._sync = function(syncOptions: object) {
  7.         //       // @ts-ignore
  8.         //       syncOptions.filterId = undefined;
  9.         //       return sync.apply(this, [syncOptions]);
  10.         //     };
  11.         //   }
  12.         // });
  13.  
  14.  
  15. // @ts-ignore
  16. function override(object, methodName, callback) {
  17.   object[methodName] = callback(object[methodName]);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement