import { IgApiClient } from 'instagram-private-api' ; import { Config } from '../core/config' ; import { mediaFeed } from './utils' ; import { store } from '../core/store' ; import logger from '../core/logging' ; async function timeline ( client , config ) { if ( config . likeLimit > 0 ) { store . pluck ( 'imageLikes' ) . subscribe ( likes => { if ( likes >= config . likeLimit ) { logger . info ( 'like limit reached. exiting process.' ) ; process . exit ( 0 ) ; } } ) ; } logger . info ( 'starting with timeline feed' ) ; return await mediaFeed ( client , config , client . feed . timeline ( 'pagination' ) ) ; } export default timeline ;