Skip to content

Instantly share code, notes, and snippets.

View Kelin2025's full-sized avatar
๐Ÿ‘‹
Let him cook

Anton Kosykh Kelin2025

๐Ÿ‘‹
Let him cook
View GitHub Profile
import { createStore, createEffect } from 'effector'
const getPost = createEffect('Fetch posts')
const $isLoading = createStore(false)
const $post = createStore(null)
const $error = createStore(null)
$isLoading
.on(getPost, () => true)
import { combine, createStoreObject } from 'effector'
const $name = createStore('Anton')
const $surname = createStore('Kosykh')
// createStoreObject creates store with object of stores states
const $profile = createStoreObject({
name: $name,
surname: $surname
})
import { interval } from 'rxjs'
import { fromObservable } from 'effector'
//emit value in sequence every 1 second
const tick = interval(1000)
const tickEvent = fromObservable(tick)
//output: 0,1,2,3,4,5....
tickEvent.watch(console.log)
const $names = createStore([])
const $completed = createStore([])
const $todos = combine(
$names,
$completed,
(names, completed) => names.map((name, i) => ({ name, completed: completed[i] })
)
$names
export const NameField = createField({
view: ({ value, onChange }) => <Input value={value} onChange={onChange} />
})
import { combine } from 'effector'
const $name = createStore('Anton')
const $surname = createStore('Kosykh')
// Creates a store with an object of stores states
const $profile = combine({
name: $name,
surname: $surname
})
@Kelin2025
Kelin2025 / ci.yml
Last active October 26, 2022 00:02 — forked from epicfaace/ci.yml
encrypting an entire github pages (mkdocs) website with staticrypt - replace MY_PASSWORD and "YOUR SITE NAME HERE"
name: Docs
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build docs