Skip to content

Instantly share code, notes, and snippets.

View rpgeeganage's full-sized avatar
:octocat:
git commit -m "wip" .

Ruwan Pradeep Geeganage rpgeeganage

:octocat:
git commit -m "wip" .
View GitHub Profile
@rpgeeganage
rpgeeganage / aSome.ts
Created November 1, 2018 22:35
Some method
/** returns boolean */
type CallBackSome<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<boolean>;
/**
* Async Some function
*
@rpgeeganage
rpgeeganage / aReduceRight.ts
Created November 1, 2018 22:29
ReduceRight method
/** returns any type value */
type CallBackReduceRight<T, R> = (
accumulator: T | R,
value: T,
index?: number,
collection?: T[]
) => Promise<T | R>;
/**
* Async ReduceRight function
@rpgeeganage
rpgeeganage / aReduce.ts
Created November 1, 2018 22:25
Reduce method
// Signature of the callback
type CallBackReduce<T, R> = (
accumulator: R,
value: T,
index?: number,
collection?: T[]
) => Promise<R>;
/**
* Async Reduce function
@rpgeeganage
rpgeeganage / aMap.ts
Created November 1, 2018 22:23
Map method
// Signature of the callback
type CallBackMap<T, R> = (
value: T,
index?: number,
collection?: T[]
) => Promise<R>;
/**
* Async Map function
*
@rpgeeganage
rpgeeganage / aForEach.ts
Created November 1, 2018 22:20
ForEach method
// Signature of the callback
type CallBackForEach<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<void>;
/**
* Async ForEach function
*
@rpgeeganage
rpgeeganage / aFindIndex.ts
Last active September 17, 2024 16:27
FindIndex method
// Signature of the callback
type CallBackFindIndex<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<boolean>;
/**
* Async FindIndex function
*
@rpgeeganage
rpgeeganage / aFind.ts
Created November 1, 2018 22:13
Find method
// Signature of the callback
type CallBackFind<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<boolean>;
/**
* Async Find function
*
@rpgeeganage
rpgeeganage / aFilter.ts
Created November 1, 2018 22:11
Filter method
// Signature of the callback
type CallBackFilter<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<boolean>;
/**
* Async Filter function
*
@rpgeeganage
rpgeeganage / aEvery.ts
Last active September 17, 2024 16:27
Every method
// Signature of the callback
type CallBackEvery<T> = (
value: T,
index?: number,
collection?: T[]
) => Promise<boolean>;
/**
* Async Every function
*