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
| module.exports = { | |
| root: true, | |
| env: { | |
| browser: true, | |
| mocha: true | |
| }, | |
| globals: { | |
| expect: true | |
| }, | |
| plugins: [], |
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
| module.exports = { | |
| root: true, | |
| env: { | |
| browser: true, | |
| mocha: true | |
| }, | |
| globals: { | |
| expect: true | |
| }, | |
| parser: '@typescript-eslint/parser', |
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
| // NOTE: We must export or import at least one thing so we are not in | |
| // the "global" scope, but in a module scope which is re-declarable. | |
| // | |
| // The error from tsserver is: 2451: Cannot redeclare block-scoped | |
| // variable 'self'. | |
| // | |
| // Even tho this is not really a module and cannot be: ServiceWorkers | |
| // cannot be modules. | |
| export type Version = number |
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 { Socket, Channel } from 'phoenix' | |
| import { encode, decode } from './serializer' | |
| import createState, { UpdateCallback } from './create-state' | |
| import { enableMapSet } from 'immer' | |
| enableMapSet() | |
| type MessageCallback = (payload?: unknown) => void | |
| type ChannelState = { |
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 produce, { Draft, Immutable } from 'immer' | |
| type Updater<S> = (state: Draft<S>) => void | S | |
| type UpdateCallback<S> = (state: Immutable<S>) => void | |
| type State<T> = { | |
| current: Immutable<T>; | |
| update: (updater: Updater<T>) => void; | |
| onUpdate: (cb: UpdateCallback<T>) => void; | |
| } |
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
| /tmp/ | |
| /lib/ |
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
| /src/ | |
| /tmp/ |
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
| on: [push] | |
| jobs: | |
| lint-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest |
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
| export function nextTick<O> (cb: () => O | Promise<O>): Promise<O> { | |
| return new Promise((resolve, reject) => { | |
| requestAnimationFrame(() => { | |
| Promise.resolve(cb()) | |
| .then(value => resolve(value)) | |
| .catch(e => reject(e)) | |
| }) | |
| }) | |
| } |
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
| def generate_id do | |
| result = | |
| Ecto.UUID.generate() | |
| |> String.replace(~r/-+/, "") | |
| |> Base.decode16(case: :lower) | |
| case result do | |
| :error -> | |
| throw("Something went wrong generating a uuid") |