This file contains hidden or 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
| type SortDirection = 'asc' | 'desc'; | |
| type SortField<T> = { | |
| field: keyof T; | |
| dir: SortDirection; | |
| }; | |
| const comparators = { | |
| string: (a: string, b: string) => a.localeCompare(b), | |
| boolean: (a: boolean, b: boolean) => Number(a) - Number(b), |
This file contains hidden or 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 { normalize } from 'normalizr'; | |
| import { API } from '@/client/apis/whatever'; | |
| import * as types from './types'; | |
| import * as schema from '@/client/store/schema'; | |
| export const fetchUserProfile = username => { | |
| return async dispatch => { | |
| dispatch({type: types.FETCH_USER_PROFILE_START}); | |
| try { |
This file contains hidden or 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
| <div class="slideshow" data-component="slideshow"> | |
| <div class="slideshow__content" data-content> | |
| <div class="slideshow__wrapper" data-slideshow> | |
| {% for element in elements %} | |
| <div class="slideshow__slide" data-slide data-title="{{ element.title }}"> | |
| <img src="{{ element.src }}" alt="{{ element.title }}"> | |
| </div> | |
| {% endfor %} | |
| </div> | |
| <div class="slideshow__pagination" data-pagination></div> |