+++ title = "Application structure" description = "Where to look for files and where to put new" date = 2019-08-20 rss = true +++
I split my source code on features/
, ui/
and pages/
.
Logic can be only in the pages/
and features/
.
{ | |
"metadata": { | |
"kernel_info": { | |
"name": "effector-editor" | |
}, | |
"language_info": { | |
"name": "ECMAScript", | |
"version": "6", | |
"mimetype": "application/javascript", |
// @jsx el | |
// @jsxFrag 'Fragment' | |
import * as React from 'react' | |
import {catalogs} from './effects/fetch-data' | |
import {createStore, createEvent, createEffect, createApi} from 'effector' | |
import {useStore} from 'effector-react' | |
const root = document.getElementById('root') | |
function el(tag, props, ...children) { |
updated String file contents via ajax |
updated String file contents via ajax |
/* | |
types: | |
simple - 2 persons | |
complex - 2 > persons | |
*/ | |
const main = { | |
messages: { | |
title: 'Messages', |
+++ title = "Application structure" description = "Where to look for files and where to put new" date = 2019-08-20 rss = true +++
I split my source code on features/
, ui/
and pages/
.
Logic can be only in the pages/
and features/
.
/* eslint-disable no-magic-numbers, unicorn/no-process-exit, no-console, prefer-template */ | |
const fs = require('fs'); | |
const path = require('path'); | |
const dotenv = require('dotenv'); | |
const dotenvExpand = require('dotenv-expand'); | |
const paths = require('./paths'); | |
// Make sure that including paths.js after env.js will read .env variables. | |
delete require.cache[require.resolve('./paths')]; |
// @flow | |
import { $baseUri } from "../model/config.store" | |
import { $token } from "../model/token" | |
type Method = "GET" | "POST" | "PUT" | "DELETE" | |
type Options = { | |
headers?: { [key: string]: string }, | |
parse?: "text" | "json" | "noparse", | |
baseUri?: string, |
For sure you've been noticed that function must be pure... or watch there is a place for side effect. Yes and we will tell about this in that section - Computation priority
A real example of queue priority - people awaiting medical treatment hospital, extreme emergency cases will have the highest priority and move on the start of the queue less significant at the end.
The main of the reason for creating Computation priority was that side effects:
import {ChangeEvent, FocusEvent} from 'react' | |
import { | |
createEvent, | |
createEffect, | |
createStore, | |
forward, | |
combine, | |
guard, | |
sample, | |
Store, |