Убран компонент Метрики

This commit is contained in:
Anton Vakhrushev 2019-08-30 12:19:54 +03:00
parent 62ce5a4591
commit 59c040a52c
3 changed files with 0 additions and 41 deletions

View File

@ -10,7 +10,6 @@
<script>
import _ from 'underscore';
import Metrika from '../common/metrika';
const NOTES = [
'Люблю фильм "Три идиота".',
@ -25,8 +24,6 @@ const NOTES = [
'Хотел бы побывать в горах.',
];
const INTERESTING_GOAL = 'INTERESTING';
export default {
data() {
return {
@ -42,7 +39,6 @@ export default {
methods: {
next() {
this.pick();
Metrika.goal(INTERESTING_GOAL);
},
pick() {
let available = _.difference(this.notes, this.shown);

View File

@ -1,23 +0,0 @@
class Metrika {
constructor(counterCb) {
this.cb = counterCb;
}
get counter() {
return this.cb.call();
}
hit(name) {
if (this.counter) {
this.counter.hit(name);
}
}
goal(name, params = {}) {
if (this.counter) {
this.counter.reachGoal(name, params);
}
}
}
export default new Metrika(() => window.yaCounter41913764);

View File

@ -40,9 +40,7 @@
<script>
import Predictor from './Predictor';
import Metrika from '../common/metrika';
const PREDICTOR_GAME_END_GOAL = 'PREDICTOR_GAME_END';
const MAX_SCORE = 50;
function make_predictor() {
@ -92,18 +90,6 @@ export default {
}
/* const prediction = */ this.predictor.pass(value);
const score = this.predictor.score;
const absScore = Math.abs(score);
// Game over
if (absScore === MAX_SCORE) {
Metrika.goal(PREDICTOR_GAME_END_GOAL, {
winner: score > 0 ? 'human' : 'robot',
step_count: this.predictor.stepCount(),
score: score,
});
}
},
restart() {
this.predictor = make_predictor();