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
export interface TalksState { | |
ids: string[] | number[]; | |
entities: Dictionary<Talk> | |
filters: Filters; | |
watched: { [id: number]: boolean }; | |
} |
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
export interface TalksState extends EntityState<Talk> { | |
filters: Filters; | |
watched: { [id: number]: boolean }; | |
} |
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
export interface TalksState extends EntityState<Talk> { | |
filters: Filters; | |
watched: { [id: number]: boolean }; | |
} | |
export interface TalksPartialState { | |
readonly talks: TalksState; | |
} | |
export const talksAdapter: EntityAdapter<Talk> = createEntityAdapter<Talk>(); |
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
@Injectable() | |
export class TalksEffects { | |
// talks$ = createEffect(() => | |
// talk$ = createEffect(() => | |
// rate$ = createEffect(() => | |
// watch$ = createEffect(() => | |
constructor( | |
private readonly backend: Backend, | |
private readonly watch: WatchService, |
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
export const talksUpdated = createAction( | |
'[Talks] Talks Updated', | |
props<{ talks: Talk[]; filters: Filters }>() | |
); | |
export const talkUpdated = createAction( | |
'[Talks] Talk Updated', | |
props<{ talk: Talk }>() | |
); |
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
export const App = () => { | |
const [tickets, setTickets] = useState<Ticket[]>([]); | |
const [agentName, setAgentName] = useState<{ name: string }>({ name: '' }); | |
useEffect(() => { | |
fetch('/api/tickets') | |
.then(t => t.json()) | |
.then(setTickets); | |
}, []); |
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
/** | |
* This is not a production server yet! | |
* This is only a minimal backend to get started. | |
**/ | |
import * as express from 'express'; | |
const app = express(); | |
app.get('/agent', (req, res) => { |
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 React, { useState, useEffect } from 'react'; | |
import { Ticket } from '@happyorg/data'; | |
import { TicketList } from '@happyorg/ticket-list'; | |
export const App = () => { | |
const [tickets, setTickets] = useState<Ticket[]>([]); | |
useEffect(() => { | |
fetch('/api/tickets') | |
.then(t => t.json()) |
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 React from 'react'; | |
import { Ticket } from '@happyorg/data'; | |
/* tslint:disable:no-empty-interface */ | |
export interface TicketListProps { | |
tickets: Ticket[]; | |
} | |
export const TicketList = (props: TicketListProps) => { |
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
export const App = () => { | |
const [tickets, setTickets] = useState<Ticket[]>([]); | |
useEffect(() => { | |
fetch('/api/tickets') | |
.then(t => t.json()) | |
.then(setTickets); | |
}, []); | |
return ( |