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, { useCallback, useEffect, useState } from "react"; | |
import { StockApi, StockInfo, StockSymbol, SubscriptionId } from "../api"; | |
interface LiveStockViewProps { | |
readonly symbol: StockSymbol; | |
} | |
interface LiveStockViewState { | |
prevStockInfo?: StockInfo; | |
stockInfo?: StockInfo; |
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, {useEffect, useState} from "react"; | |
import {AppProps} from "./LegacyApp"; | |
import {StockApi, StockInfo, StockSymbol, SubscriptionId} from "../api"; | |
function App(props: AppProps) { | |
const [state, setState] = useState({selectedSymbol: props.symbols[0]}) | |
const handleOnClick = (e: React.MouseEvent<HTMLDivElement>) => { | |
e.preventDefault(); | |
const symbol = (e.target as HTMLAnchorElement).getAttribute( |
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
public class RealmListParcelConverter implements TypeRangeParcelConverter<RealmList<? extends RealmObject>, RealmList<? extends RealmObject>> { | |
private static final int NULL = -1; | |
@Override | |
public void toParcel(RealmList<? extends RealmObject> input, Parcel parcel) { | |
if (input == null) { | |
parcel.writeInt(NULL); | |
} else { | |
parcel.writeInt(input.size()); | |
for (RealmObject item : input) { |
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
KompendiumProgramistyJavaCwiczeniaWydanieIX |