Loose coupling and high reusability of view + businesss logic
- High reusability of BL
Several disconnected features can utilize another feature with all it has inside. We can compose features oneffector
level
const fs = require('fs'); | |
const path = require('path'); | |
const today = new Date(); | |
const dd = String(today.getDate()).padStart(2, '0'); | |
const mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! | |
const yyyy = today.getFullYear(); | |
const dateString = `${dd}.${mm}.${yyyy}`; | |
fs.writeFileSync(path.join(__dirname, '.env'), `VERSION=${dateString}`); |
import { createStore, createEvent, createEffect } from 'effector'; | |
import { $problemId } from './problem'; | |
import { createApiStore } from 'utils/store'; | |
import { submitApi, runCodeApi } from 'api'; | |
import { batchCombine } from 'utils/effector'; | |
/** | |
* EVENTS, EFFECTS | |
* ---------------------------------------------------------------------------- |
There is a contract between Platform and Modules, so in order to co-operate they both must follow some rules.
Данный документ содержит общие правила и рекомендации по составлению контента
[v][\v]
(если возможно)LaTeX
, разбивать длинные формулы на несколько строк с помощью \\
чтобы на мобильниках хорошо выглядело// allows to memoize function by its first argument | |
// this is only partial implementation (can be extended to memoize all arguments though) | |
const weakMemoizeOne = fn => | |
{ | |
const wmap = new WeakMap(); | |
const wfn = arg => | |
{ | |
if(!wmap.has(arg)) | |
wmap.set(arg, fn(arg)); |
const MIN_BASE = 10; | |
const LIMIT = .7; | |
const GROW_SCALE = 2; | |
class HashMap | |
{ | |
constructor(base = MIN_BASE) | |
{ | |
Object.assign(this, this._genNew(base)); | |
} |
function Mutilator(data, name, context) { | |
this.n = name || `mutilation-${+new Date()}`; | |
this.d = data; | |
this.c = context || window; | |
this.isArr = function(p) { | |
return this.d[p].constructor == Array; | |
}; | |
this.dispatch = function(p, v, t) { | |
this.c.dispatchEvent( | |
new CustomEvent(this.n, { |