accelerator-core
Version:
[](https://travis-ci.org/furkleindustries/accelerator-core)
28 lines (26 loc) • 652 B
text/typescript
import {
ActionTypes,
} from '../ActionTypes';
import {
IPassage,
} from '../../passages/IPassage';
import {
IPassageNavigationAction,
} from '../IPassageNavigationAction';
import {
MaybeReadonlyArray,
} from '../../typeAliases/MaybeReadonlyArray';
import {
Tag,
} from '../../tags/Tag';
import { getStructuredTags } from '../../tags/getStructuredTags';
export const createPassageNavigationAction = (
passage: IPassage,
linkTags: MaybeReadonlyArray<Tag> = Object.freeze([]),
): IPassageNavigationAction => Object.freeze({
type: ActionTypes.PassageNavigation,
value: {
linkTags: getStructuredTags(linkTags),
passage,
},
});