clean up exports and imports
This commit is contained in:
parent
748649bde3
commit
cf49fb47d6
|
@ -1,5 +1,5 @@
|
||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import { DateTimeWrapper } from './date-time-wrapper'
|
import DateTimeWrapper from './date-time-wrapper'
|
||||||
|
|
||||||
test('#getShortDate usual date', t => {
|
test('#getShortDate usual date', t => {
|
||||||
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
|
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { DateTime } from 'luxon'
|
import { DateTime } from 'luxon'
|
||||||
|
|
||||||
export class DateTimeWrapper {
|
export default class DateTimeWrapper {
|
||||||
|
|
||||||
constructor(text) {
|
constructor(text) {
|
||||||
this.dateTime = DateTime.fromISO(text)
|
this.dateTime = DateTime.fromISO(text)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { DateTimeWrapper } from './date-time-wrapper'
|
import DateTimeWrapper from './date-time-wrapper'
|
||||||
import * as GraphqlWrapper from './graphql-wrapper'
|
import * as GraphqlWrapper from './graphql-wrapper'
|
||||||
import * as HtmlCreator from './html-creator'
|
import { createAnchorElement } from './html-creator'
|
||||||
|
|
||||||
const NAME = '<wordpress-name>'
|
const NAME = '<wordpress-name>'
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ function displayEvents(data, list) {
|
||||||
for (let i = 0; i < eventsCount; i++) {
|
for (let i = 0; i < eventsCount; i++) {
|
||||||
const li = document.createElement('li')
|
const li = document.createElement('li')
|
||||||
|
|
||||||
const a = HtmlCreator.createAnchorElement({ text: events[i].title, url: events[i].url })
|
const a = createAnchorElement({ text: events[i].title, url: events[i].url })
|
||||||
li.appendChild(a)
|
li.appendChild(a)
|
||||||
|
|
||||||
const br = document.createElement('br')
|
const br = document.createElement('br')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { SessionCache } from './session-cache'
|
import SessionCache from './session-cache'
|
||||||
import { request } from 'graphql-request'
|
import { request } from 'graphql-request'
|
||||||
import { DateTimeWrapper } from './date-time-wrapper'
|
import DateTimeWrapper from './date-time-wrapper'
|
||||||
|
|
||||||
export function getUpcomingEvents({ url, limit }) {
|
export function getUpcomingEvents({ url, limit }) {
|
||||||
const query = `
|
const query = `
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import { SessionCache } from './session-cache'
|
import SessionCache from './session-cache'
|
||||||
|
|
||||||
const fakeStorage = {
|
const fakeStorage = {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import hash from './object-hash-wrapper'
|
||||||
|
|
||||||
const MAX_AGE_IN_MS = 120000
|
const MAX_AGE_IN_MS = 120000
|
||||||
|
|
||||||
export class SessionCache {
|
export default class SessionCache {
|
||||||
|
|
||||||
static add(storage, parameters, data) {
|
static add(storage, parameters, data) {
|
||||||
const key = hash(parameters)
|
const key = hash(parameters)
|
||||||
|
|
Loading…
Reference in New Issue