Skip to content

Instantly share code, notes, and snippets.

💭
Set your status

Dmitry zerobias

💭
Set your status
Block or report user

Report or block zerobias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zerobias
zerobias / lsdb.ts
Created Nov 27, 2019
Reactive database with localStorage and effector
View lsdb.ts
import {
createEvent,
createStore,
createEffect,
combine,
forward,
Effect,
Store,
Event,
step
@zerobias
zerobias / h.ts
Last active Dec 2, 2019
Declarative stack-based DOM api
View h.ts
import {
createStore,
createEvent,
is,
clearNode,
forward,
sample,
Store,
Event,
launch
@zerobias
zerobias / proposal_tasks.md
Last active Jul 18, 2019
effector proposal: tasks
View proposal_tasks.md

Tasks

try it

Current effect behavior

const fx = createEffect({
  handler(params) {
    console.log(params)
  },
View markdown_ast.json
{
"type": "root",
"children": [
{
"type": "thematicBreak",
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
View list.js
import React from 'react'
import ReactDOM from 'react-dom'
function iterate(unit) {
const source = createEvent()
const begin = createEvent()
const end = createEvent()
const iteration = createEvent()
const item = iteration.map(({value}) => value)
View storeList.ts
import {createEvent, createStore, Event, forward, Store} from 'effector'
export class Iteration<T> {
index: number
item: T
list: T[]
constructor(index: number, item: T, list: T[]) {
this.index = index
this.item = item
this.list = list
@zerobias
zerobias / index.js
Created Jun 16, 2019
todolist for effector-react with hooks
View index.js
import React from 'react'
import ReactDOM from 'react-dom'
import {createEvent, createStore, createApi, sample, combine} from 'effector'
import {useStore} from 'effector-react'
const inputStore = createStore('')
const todos = createStore([])
const visibilityFilter = createStore(todos => todos)
const submit = createEvent('sumbit form')
View element.js
//@flow
/* eslint-disable no-unused-vars */
import {createStore, createEvent, type Store, type Event} from 'effector'
declare export function element<P, R>(tag: (props: P) => R, props: P): R
declare export function element(
tag: 'span',
props: {
class?: {[field: string]: string},
content: Store<string>,
@zerobias
zerobias / effector.prettify.es.js
Created May 22, 2019
effector 0.18.10 with prettier
View effector.prettify.es.js
function e({
node: e,
child: t = [],
from: n = [],
scope: r = {},
meta: o = {},
}) {
return {from: n.map(Q), seq: e, next: t.map(Q), meta: o, scope: r}
}
function t(e) {
You can’t perform that action at this time.