-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipeCases()() and LinkedIn likeArticlesFrom() (#75)
* pipeCases()() and likeAllFrom() #61 #55 - pipeCases()() like pipeCase()() except ALL cases must match for it to return a MatchesSignal with matches and pipeValue - LinkedIn likeAllFrom(...peopleNames) uses switchPipe() and pipeCase()() to test post for type * Renamed MatchesSignal -> CasesSignal + new prop `conditionPass` - added `conditionPass` property to CasesSignal so it can return matching cases while still presenting itself as not ran since the overall condition failed (did not pass) * pipeCases()() unit-tests * pipeCases()() & pipeCase()() abortlinesignal tweak - similar to switchPipe handling abort line signals, it takes multiple abort assembledLines to fully abort out of pipeCase(s) cz its 1 to abort the line assembled and a second to abort the CasesSignal return versus an AbortLineSignal return - if pipeValue returned, it was abort(2)'s pipeValue * pipeAbort(), house cleaning, conditionalCallbacks * pipeCase(s) specifies type CaseValues for callback of testable value * pipeAbort() supports conditional callback or a pipevalue to test against pipevalue and if true, then return AbortLineSignal(1, pipeValue?) * linkedin example using likeArticlesFrom() - going beyond function scope but to show a more detailed example on how a feed could be processed with switchPipe()() * introduced new botaction scrollTo() which includes a static wait of 2.5 seconds for the scroll to finish (add more if you need more) - this update includes the ability to let the LinkedIn app lazily load each post if it hasnt been loaded yet, with a special check - complete but not recently tested likeArticle() functionality since using fictional character names * helpers/navigation unit-testing * helpers/cases unit-test * navigation/actions unit-test scrollTo() * evaluate() botaction with integration test
- Loading branch information
Showing
24 changed files
with
757 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Dictionary, PipeValue } from "../types" | ||
import { CasesSignal, isCasesSignal } from "../types/cases" | ||
|
||
/** | ||
* Create a CasesSignal object with safe defaults for no params provided (default is no matches, pipe value undefined, and conditionPass false) | ||
* @param matches | ||
* @param pipeValue | ||
*/ | ||
export const createCasesSignal = <V = any>(matches: Dictionary<V> = {}, conditionPass: boolean = false, pipeValue?: PipeValue): CasesSignal<V> => ({ | ||
brand: 'Cases_Signal', | ||
conditionPass, | ||
matches, | ||
pipeValue | ||
}) | ||
|
||
/** | ||
* If a CasesSignal is provided, its pipeValue is returned, otherwise `undefined` is returned | ||
* @param casesSignal | ||
*/ | ||
export const casesSignalToPipeValue = (casesSignal: CasesSignal|any): PipeValue => | ||
isCasesSignal(casesSignal) ? casesSignal.pipeValue : undefined |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.