- Some variables to avoid writting too much and create some folders:
export PODNAME="nextcloud"
mkdir -p ~/containers/nextcloud/{db,nginx,html}
- Copy the
nginx.conf
file:
import {useEffect} from 'react'; | |
type EventKey = string; | |
type EventHandler<T = any> = (payload: T) => void; | |
type EventMap = Record<EventKey, EventHandler>; | |
type Bus<E> = Record<keyof E, E[keyof E][]>; | |
interface EventBus<T extends EventMap> { | |
on<Key extends keyof T>(key: Key, handler: T[Key]): () => void; | |
off<Key extends keyof T>(key: Key, handler: T[Key]): void; |
const express = require('express') | |
const {createStore, createEvent, sample} = require('effector') | |
const clientConnected = createEvent() | |
const statusRequested = createEvent() | |
const updateReceived = createEvent() | |
const clientClosed = createEvent() | |
const pushUpdate = createEvent() | |
const clients$ = createStore([]) | |
.on(clientConnected, (list, client) => [...list, client]) |
export PODNAME="nextcloud"
mkdir -p ~/containers/nextcloud/{db,nginx,html}
nginx.conf
file:
import React, { useReducer } from "react"; | |
interface State { | |
userName: string; | |
password: string; | |
isValid: boolean; | |
} | |
const initialState: State = { | |
userName: "", |
'use strict'; | |
const queryString = (params) => { | |
const qs = String(new URLSearchParams(params)); | |
return qs ? `?${qs}` : ""; | |
}; | |
const joinBase = (url, baseUrl) => | |
`${baseUrl.replace(/\/$/, "")}/${url.replace(/^\/|\/$/, "")}/`; |
const queryString = (params) => { | |
const qs = String(new URLSearchParams(params)); | |
return qs ? `?${qs}` : ""; | |
}; | |
const joinBase = (url, baseUrl) => | |
`${baseUrl.replace(/\/$/, "")}/${url.replace(/^\/|\/$/, "")}/`; | |
const contentTypeJson = { "Content-Type": "application/json" }; |
const d = createDomain(); | |
d.onCreateStore((store) => { | |
store.updates.watch((value) => { | |
console.log(`STORE ${store.shortName} UPDATED`, value); | |
}); | |
}); | |
d.onCreateEvent((event) => { | |
event.watch((parameters) => { |
import { createEffect, createEvent, createStore, merge } from 'effector'; | |
import nanoid from 'nanoid'; | |
import { request, parseObject } from 'jsonrpc-lite'; | |
const wsURL = `ws://localhost:${process.env.WS_PORT}`; | |
let socket; | |
const awaitingMap = new Map(); | |
function cleanSocket() { |
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 | |
* ---------------------------------------------------------------------------- |
import { useEffect, useRef, useCallback } from 'react'; | |
import { createEvent, createStore } from 'effector'; | |
import { useStore } from 'effector-react'; | |
const open = createEvent('open'); | |
const closed = createEvent('closed'); | |
const error = createEvent('error'); | |
const wsStatus = createStore('closed') |