Skip to content

Instantly share code, notes, and snippets.

View RafalFilipek's full-sized avatar
馃槺

Rafau RafalFilipek

馃槺
View GitHub Profile
<h1>Orange</h1>
<h2>jest cool</h2>
<p>
lorem stuff
</p>
@RafalFilipek
RafalFilipek / machine.js
Last active December 25, 2019 21:22
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
id: 'error',
context: {
list: null,
currentItem: null,
},
initial: 'init',
states: {
init: {
on: {
@RafalFilipek
RafalFilipek / machine.js
Created December 25, 2019 21:10
Generated by XState Viz: https://xstate.js.org/viz
const suffMachine = Machine({
id: 'stuff',
initial: 'idle',
context: {
/**
*This value is provied from external sourcre.
*/
isLogged: false
},
states: {
@RafalFilipek
RafalFilipek / SketchSystems.spec
Last active March 2, 2020 15:03
# Wyrazy rozpoczynaj膮ce si臋 od ma艂ej litery s膮聽stanami.
# Wyrazy rozpoczynaj膮ce si臋 od ma艂ej litery s膮聽stanami.
# Wyrazy pisane wielkimi literami s膮 akcjami.
#
# `_entry` - akcja wykonyana na wej艣ciu do danego stanu
# `_entry_[suffix]` - akcja w wykonywana na wej艣ciu do danego podstanu. Sufix jest niezb臋dny aby unikn膮膰聽kolizji nazw
# `_entry - condition? [value]` -> akcja wykonywana tylko gdy `condition [value]` jest spe艂niona
Sufler
Resolve*
_entry -> offerGroups
@RafalFilipek
RafalFilipek / SketchSystems.spec
Created December 20, 2019 13:24
Grupy Ofert*
Grupy Ofert*
WYB脫R GRUPY -> Oferty
Oferty
# Na wej艣ciu
_ENTRY
Tylko jedna oferta w grupie
# Wywo艂anie akcji
Tak? -> WYB脫R OFERTY
Sufler
Oferty i Grupy Ofert*
wyb贸r grupy -> Lista Ofert
wyb贸r oferty -> Lista Proces贸w
Lista Ofert
wyb贸r oferty -> Wymagania Oferty
powr贸t -> Oferty i Grupy Ofert
Wymagania Oferty
@RafalFilipek
RafalFilipek / SketchSystems.spec
Created December 7, 2019 23:05
My Awesome Sketch
My Awesome Sketch
Oferty i Grupy Ofert*
wyb贸r grupy -> Lista Ofert
wyb贸r oferty -> Lista Proces贸w
Lista Ofert
wyb贸r oferty -> Lista Proces贸w
powr贸t -> Oferty i Grupy Ofert
Lista Proces贸w
@RafalFilipek
RafalFilipek / m.tsx
Created November 24, 2019 22:18
1 hour with xstate
/**
* xstate - 4.7.0-rc.6
* typescript - 3.7.2
*/
import React from "react";
import { createMachine, assign } from "xstate";
import { useMachine } from "@xstate/react";
interface Context {
name?: string;
@RafalFilipek
RafalFilipek / machine.js
Created November 21, 2019 10:27
Generated by XState Viz: https://xstate.js.org/viz
const suflerMachine = Machine({
initial: "types",
states: {
types: {
on: {
SELECT_TYPE: {
target: "processes",
actions: [
assign({
typeId: (_context, event) => event.id
alert(x)