nl_tokens: Hook RemoteStorage . syncCycle as it s the first function called after RemoteStorage . sync is initialized so we can then hook the sync function
pl_tokens: function hookSyncCycle ( rs ) { if ( rs . _dropboxOrigSyncCycle ) { return ; } // already hooked rs . _dropboxOrigSyncCycle = rs . syncCycle ; rs . syncCycle = ( ) => { if ( rs . sync ) { hookSync ( rs ) ; rs . _dropboxOrigSyncCycle ( arguments ) ; unHookSyncCycle ( <mask> ) ; } else { throw new Error ( 'expected sync to be initialized by now' ) ; } } ; }