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
import { | |
calcPageNumbers, | |
calcOffset, | |
calcPageCount, | |
getPageItems, | |
} from './paging-utils'; | |
// We'll use lodash's `clamp` function | |
import clamp from 'lodash/clamp'; |
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
import { | |
calcPageNumbers, | |
calcOffset, | |
calcPageCount, | |
getPageItems, | |
} from './paging-utils'; | |
// We'll use lodash's `clamp` function | |
import clamp from 'lodash/clamp'; |
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
import range from 'lodash/range'; | |
/** | |
* Returns the items in a given page. | |
* @template T | |
* @param {number} offset The index offset based on the given `pageIndex` | |
* (precomputed from `calcOffset`). | |
* @param {number} itemsPerPage The number of items per page. | |
* @param {T[]} items The array of items. | |
*/ |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
- https://www.toptal.com/javascript/comprehensive-guide-javascript-design-patterns
- https://addyosmani.com/resources/essentialjsdesignpatterns/book/
- http://gameprogrammingpatterns.com/contents.html
- https://en.wikipedia.org/wiki/Design_Patterns
- https://www.dofactory.com/javascript/composite-design-pattern
- https://anasshekhamis.com/2017/10/12/the-composite-design-pattern-in-javascript/
NewerOlder