This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| component$, | |
| HTMLAttributes, | |
| QRL, | |
| Slot, | |
| useSignal, | |
| useTask$, | |
| } from "@builder.io/qwik"; | |
| interface Movement { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| useResource$, | |
| useSignal, | |
| useTask$, | |
| ResourceReturn, | |
| } from "@builder.io/qwik"; | |
| import { MasonryPhoto } from "~/trcp/router"; | |
| export type State = "blank" | "blurry" | "done"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { $, useEnvData, useStore } from "@builder.io/qwik"; | |
| import { isBrowser, isServer } from "@builder.io/qwik/build"; | |
| import { GraphQLClient, rawRequest } from "graphql-request"; | |
| import { parse, serialize } from "cookie"; | |
| export const AUTH_TOKEN_KEY = "vendure-auth-token"; | |
| export function getHeaders() { | |
| const headers: HeadersInit = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function debounce(fn, interval) { | |
| let timeout; | |
| return function(...args) { | |
| clearTimeout(timeout); | |
| return new Promise(resolve => { | |
| timeout = setTimeout(() => resolve(fn(...args)), interval); | |
| }); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let (>>=) = (m: chainableList('a), f: list('a) => chainableList('b)) => { | |
| switch(m) { | |
| | Value(l) => doSomeStuffAndReturn(l |> f) | |
| | Failure => logThisFailure(m); Failure | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Fluent list operations in ReasonML */ | |
| let l = return([1, 2, 3]) | |
| >>= wrap(List.map(n => n * 2)) | |
| >>= wrap(List.filter(n => n mod 2 != 0)) | |
| >>= tail; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let return = x => Value(x); | |
| let wrap = (f, l) => return(l |> f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let (>>=) = (m: chainableList('a), f: list('a) => chainableList('b)) => switch(m) { | |
| | Value(l) => l|> f | |
| | Failure => Failure | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let tail = x => switch(x |> List.tl) { | |
| | l => Value(l) | |
| | exception _ => Failure | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type chainableList('a) = | |
| | Value(list('a)) | |
| | Failure; |
NewerOlder