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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| // please read it in the following order: saga-base.ts, sample-saga.ts, root-saga.ts, index.ts | |
| // then to add sagas to a redux store in index.ts: | |
| const sagaMiddleware = createSagaMiddleware(); | |
| const store = createStore(history, [sagaMiddleware, routerMiddleware(history)]); | |
| const sagas = new RootSaga(axiosInstance, store); |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| // although these functions are deprecated in node they are much more readable for me than an ordinary `===` comparison | |
| export function isNull(val: any): val is null { | |
| return val === null; | |
| } | |
| export function isUndefined(val: any): val is undefined { |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| // undefined when not fetched yet | |
| export interface State { | |
| a: A[] | undefined; | |
| b: B | undefined; | |
| } | |
| export const initialState: State = { |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| // A proof of concept class to generate response and request action and handle reducing them | |
| import { RequestSaga } from "../request-saga"; | |
| import { put } from "redux-saga/effects"; | |
| import { Map } from "immutable"; | |
| export type RequestType = 'GET' | 'PUT' | 'POST' | 'DELETE'; |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| import { Action, AnyAction, combineReducers, Reducer, ReducersMapObject } from "redux"; | |
| import { isUndefined } from "../util"; | |
| export type SimplifiedReducer<State, Action> = (state: State, action: Action) => State; | |
| export type SimplifiedReducersMapObject<S> = {[key in keyof S]: SimplifiedReducer<S[key], any>}; | |
| /** |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| import { composeValidators, ValidatorFn } from "./index"; | |
| import { WithNamespaces } from "react-i18next"; | |
| import React from "react"; | |
| import { Props } from "../components/Range"; | |
| /** | |
| * Always adds a validator to input props, requires translation withNamespaces decorator |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| const gulp = require('gulp'); | |
| const del = require('del'); | |
| const ngc = require('@angular/compiler-cli/src/main').main; | |
| const fs = require('fs'); | |
| var paths = { | |
| dist: __dirname + '/dist', |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| import i18n from "i18next"; | |
| import { reactI18nextModule } from "react-i18next"; | |
| export const translationResources = { | |
| pl: { | |
| translation: { | |
| // translations here |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/1.0/" | |
| /** | |
| * A nice idea to separate REST ID from data content, so it is easier later to make e.g. a map out of such items | |
| */ | |
| export interface WithId<T, Id = number> { | |
| id: Id; | |
| data: T; | |
| } |
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
| // To the extent possible under law, Kamil Neczaj has waived all copyright and related or neighboring rights to this code, | |
| // which is published here under license CC0, full text of the license here: http://creativecommons.org/publicdomain/zero/ | |
| import { By as ByBase } from 'selenium-webdriver'; | |
| export class By extends ByBase { | |
| static content(content: string): By { | |
| return ByBase.xpath(`//*[contains(text(), '${content}')]`); | |
| } | |
OlderNewer