$(document).ready
, потом внутри (б) if ($.cookie(KEY) == null) {
и потом внутри (в) setTimeout(function(){
type IFooIndex = string & {_type?: 'foo'};
type IBarIndex = string & {_type?: 'bar'};
class Foo {
id: IFooIndex;
}
class Bar {
id: IBarIndex;
}
function findFoo(index: IFooIndex) {
// searching by IFooIndex
}
type IFooCacheError = { [id: IFooIndex]: Foo }; // ERROR
type IFooCache = { [id: string]: Foo };
const fooCache = {} as IFooCache;
fooCache['ab' as IFooIndex];
fooCache['ab' as IBarIndex]; // NO ERROR
int X = this.X
в аргументах. this.setState(s => ({
data: s.data.filter(it => it.id !== deletedId)
}));