import {createSelector} from '@reduxjs/toolkit';
export const selectRawTranscript = createSelector(
(state: RootState) => state.data.someRawValue,
(rawValue) => rawValue.map(entry => entry.data)
);
import { configureStore } from '@reduxjs/toolkit';
import playlistReducer from './playlistSlice.js';
export default configureStore({
reducer: {
// Свойство counter будет внутри объекта общего состояния: state.counter
playlist: playlistReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: false,
}),
});
import { configureStore } from '@reduxjs/toolkit';
import playlistReducer from './playlistSlice.js';
export default configureStore({
reducer: {
// Свойство counter будет внутри объекта общего состояния: state.counter
playlist: playlistReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: false,
}),
});
return !isNaN(time)
? ("0" + Math.floor(time / 60)).slice(-2) +
":" +
("0" + Math.floor(time % 60)).slice(-2)
: "00:00";
function declOfNum(number, words) {
return words[(number % 100 > 4 && number % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(number % 10 < 5) ? Math.abs(number) % 10 : 5]];
}
declOfNum(1, ['минута', 'минуты', 'минут']);
function orm() {
let value;
let sql;
return {
table: function (input) {
value = input;
return this;
},
findAll: function () {
sql = `SELECT * FROM ${value}`;
return this;
},
where: function (key, value) {
sql += ` WHERE ${key} = ${value}`;
return this;
},
create() {
return sql;
},
};
}
bilder = orm();
console.log(
bilder.table("Customers").findAll().where("city", "London").create()
);
//SELECT * FROM Customers WHERE city = London
player.playButton.addEventListener("click", (e) => player.playAudio(e));
playAudio() {
this.audio.play();
this.playButton.style.display = "none";
this.pauseButton.style.display = "block";
}