profile
viewpoint
Christian Gill gillchristian @housinganywhere Rotterdam, Netherlands https://gillchristian.xyz Open Source all the things \o/

startedceddlyburge/elm-master-view-types

started time in 5 days

pull request commentonivim/oni2

support(menu): Fix cycle up

@bryphe it's been a while since I opened this PR, even the first release happened :tada:

I rebased with master and there are two problems.

First I force pushed to my branch without your changes :face_with_head_bandage:

Also I tried to run the tests again but I get an error when building, maybe it's better to ask in Discord about this :thinking:

$ esy '@test' build
info building reason-libvim@github:onivim/reason-libvim#5c81c76@d41d8cd9
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: reason-libvim@github:onivim/reason-libvim#5c81c76
    # esy-build-package: pwd: /home/gillchristian/.esy/3____________________________________________________________/b/reason_libvim-445ec134
    # esy-build-package: running: 'refmterr' 'dune' 'build' '-p' 'libvim'
        discover src/c_flags.sexp,src/cxx_flags.sexp,src/flags.sexp
    -L/home/gillchristian/.esy/3/i/libvim-8.10869.19-49bdd02b/lib
        ocamlopt src/vim.cmxs (exit 2)
    (cd _build/default && /home/gillchristian/.esy/3/i/ocaml-4.7.1004-a6ae015e/bin/ocamlopt.opt -w -40 -g -shared -linkall -I src -o src/vim.cmxs src/vim.cmxa)
    /usr/bin/ld: cannot find -lacl
    collect2: error: ld returned 1 exit status
    File "caml_startup", line 1:
    Error: Error during linking
    error: command failed: 'refmterr' 'dune' 'build' '-p' 'libvim' (exited with 1)
    esy-build-package: exiting with errors above...

  building reason-libvim@github:onivim/reason-libvim#5c81c76
esy: exiting due to errors above
gillchristian

comment created time in 16 days

push eventgillchristian/oni2

Ryan C

commit sha 54a7a6643d09ba80ea4c8fd644a55233dc5779aa

Start hooking up missing config options. (#286) * Start hooking up missing config options. * Formatting

view details

Bryan Phelps

commit sha 3d72cb281ee994a8ddb1c459796c985cb6078e65

Dependency: reason-libvim -> 8.10869.12001 (#367) * reason-libvim -> 8.10869.12001 * Update lockfiles

view details

Bryan Phelps

commit sha d37aac239929d89b5eea41046be0fbae738c05ce

Logging: Log unhandled exceptions to log file (#368) * Log unhandled exceptions when debug logging is enabled * Remove debug exception * Bump

view details

Yanix

commit sha 9ead5e0cdb25e54a02299f2293d664f9db14bdef

Configuration - Add 'workbench.editorshowTabs' option (#369) * Fix https://github.com/onivim/oni2/issues/365 - Add 'workbench.editor.showTabs' option Add 'workbench.editor.showTabs' option. Verified by setting the value to false and make sure we don't see any tabs. * Minor: Change parse name from 'workbench.editor.showTab' -> 'workbench.editor.showTabs' * Formatting

view details

Bryan Phelps

commit sha 283304d4f9e8f492c4f44b5263d5ec00ecc3b58d

Release - Disable extension host for July builds (#370) * Disable extension host for the July release * Formatting

view details

Corentin Leruth

commit sha 4a03121393d77a3c29da4c59e70013289ab334ff

Configuration: Auto-reload when saving (#371) * auto reload config on change * improve naming * Fix warning about return value of Vim.AutoCommands.onDispatch

view details

Endre Vegh

commit sha 27fe4229303c1cc49c7e673336cd7dcdcc5683f1

Add sorting by folder && name (#377) * add sorting * fix newLine

view details

Bryan Phelps

commit sha 4ba120ca4f08f5a5cf3a5dd4e00a6ec8cd3912a8

Bugfix - OSX: Indentation after using QuickOpen (#378) * Don't send <D-> if no key is pressed with it * Add <D-S-> to blocked list * Remove accidentally added package-lock

view details

Bryan Phelps

commit sha 79ef0de5c17161d440d42995d2a4e68147cded8f

Dependency: revery -> 0.22.0 (#380) * Upgrade revery -> 0.22.0 * Update lockfiles * Fix UI reference

view details

Bryan Phelps

commit sha 34511d0f488e7e4deeda6a383d7823de448c67da

Dependency: revery -> 0.24.0 (#384) * Update dependencies * Pin ocaml-migrate-parsetgree@1.3.1

view details

Bryan Phelps

commit sha f7b607e93164ac093c16611496b5ea84a4568078

Dependency: reason-libvim@8.10869.14001 (#385) * 8.10869.14001 * Update lockfiles

view details

Bryan Phelps

commit sha ceb58003079578adf6189804b8a24a57e713d638

Release Packages: Copy built binaries to '_release' folder (#373) * Add 'create-release' to the esy-build-steps * Step to release artifact * Pass platform template parameter * Update lockfiles * Check that we pick up esy-dylibbundler * Release script updates * Generate plist * Update lockfiles * Add dmg-background image * Add release script * 1024px icon * Add icon files + script * Update dmg background * Update release.js * Fix up strategy for Win / Linux * 8.10869.14001

view details

Bryan Phelps

commit sha 46f4bf69741f83d0ffc606a9b66b0be08fab70b3

Dependency: reason-libvim -> 8.10869.15001 (#389) * reason->libvim@8.10869.15001 * Update lockfiles

view details

Bryan Phelps

commit sha e9a61982282abfbc1a499cb5f15a8c7682311816

Feature: Command line completion (#357) * Print command line matches * More tweaks * Fix up * Show completions in wildmenu * Hook up menu bindings to work with command mode too * Progress on auto-completion * Hook up auto-completion * Handle previous event * Add tab/shift tab to default key bindings * Clean up logging * Formatting * Remove unused open

view details

Bryan Phelps

commit sha 6f1d7c9528b1f0a1dcbbf9feae77262c48c82f71

Ex: Hook up 'vsp' and 'sp' commands (#387) * Hook up vsp/sp/tabnew * Window movement logging * Try multiple actions * Add split handling in OpenFileByPath * Update OpenFileByPath to take a split direction as an arg * Formatting * Clean up VimStoreConnector

view details

Bryan Phelps

commit sha 5d78b14aa8681638151c93c3758a01a9e9677a42

Editor: Synchronize cursor position (#352) * Logging * Fix merge * Synchronize left column position * Finish synchronizing attributes * Fixes * Some cleanup * Formatting

view details

Bryan Phelps

commit sha 1b5bd02758285c4d989d08aceb067c9706b46a85

Change prerr_endline -> Log.error (#390) * prerr_endline -> Log.error * Missed file * Remove prerr from ExtHostClient * Formatting

view details

Bryan Phelps

commit sha 0ade0022c9d0b7d6195c5dc7aae8a1e423e921ba

Release: Windows installer script (#386) * Add dependencies * Setup app template * Windows setup script * Update lockfiles

view details

Bryan Phelps

commit sha 3e57775f4059fca48484aea639311695e3975f23

WindowTree/WindowManager: Refactoring in preparation for window movement (#388) * Get test green * Split out WindowTree * Refactor in preparation for window movement * Formatting * Add layout * WindowTreeLayout * Initial layout tests * Use pipe * Tweak the way the editor tree is rendered * Add mixed layout test * Switch to use whole split * Update EditorLayoutView to use new layout method * Formatting * Track active window id for splits * Hook up measurements to window tree layout * Get parity with behavior before * Formatting * Remove unnecessary logging * Formatting

view details

Bryan Phelps

commit sha a9ba3e64147236e1108454c4d82d38995ce90576

Feature: Window movement (#392) * Add logic for moving splits * Initial window movement implementation * Refactor to keep window / editorgroup in sync * Formatting * Progress * Formatting * Correct start position * Some cleanup

view details

push time in 16 days

issue commentHuemul/trae

How to handle error response with failure status?

@AnshulM34 thanks for reporting. I formatted a bit your message, added syntax highlighting. I suggest you keep that in mind when opening and issue, it things easier to understand for us maintainers.

It's a bit hard to reproduce your issue because we lack the context. If you would provide and example in Codesandbox.

That said, I have a guess of what's causing your issue. We also parse the response when there's an error. Seeing "Unexpected end of JSON input" we are using the json parser when we shouldn't. At the moment I'm not sure if that could be changed, but we'll improve it for sure on the v2

Here's the code:

https://github.com/Huemul/trae/blob/fa83b7ffd4013f35b52447a397a8a734afa406df/lib/helpers/response-handler.js#L8-L17

You can check the headers of the response of your API, maybe it says application/json when it shouldn't.

AnshulM34

comment created time in 18 days

issue commentHuemul/trae

multipart form data?

@cmoralesheras eres bienvenido a colaborar en la librería, nosotros lo hacemos en nuestro tiempo libre

En el momento empezamos a trabajar en la v2 y nos gustaría resolver en issue ahí

lopezchr

comment created time in 18 days

issue closedHuemul/trae

Error

Hola,

Lo primero enhorabuena por este estupendo desarrollo. Deciros que no soy un mega experto en la materia, pero estoy intentando utilizar vuestra librería, contra mi API REST (desarrollada en Java), y me encuentro con un problema al acceder vía POST a uno de mis métodos:

Error
    at u (trae.umd.min.js?fdb7:1)
    at eval (trae.umd.min.js?fdb7:1)

desde un componente Vue.

Si lo intento directamente con FETCH:

const url = 'http://192.168.10.1:8080/myapp/nuix/login/user/password/2'

fetch(url, {
    method: 'POST'
}).then(response => response.json()).then(data => console.log(data));

obtengo la respuesta perfecta en JSON, pero con 'trae':

return nuixService.post('/login/user/password/2')
        .then(function (res) {
            return res.data
        })

siendo nuixService:

const nuixService = trae.create({
    baseUrl: configService.dsrUrl
})

y configService:

const configService = {    
    dsrUrl: 'http://192.168.10.1:8080/myapp/nuix'
}

Muy agradecido si me pueden orientar, quizá no estoy haciendo algo bien. Saludos.

closed time in 18 days

jluisperez

issue commentHuemul/trae

Error

Si, hay un error en el request. Lo puedes ver aqui.

Si haces lo mismo en el código de tu app (log de las propiedades que tiene el objeto de error en el .catch). Para entender más que contiene la respuesta y el error puedes ver la documentación.

El problema del lado de trae es que el error no tiene un mensaje porque el servidor no responde con statusText así que eso deberiamos arreglar (empezamos a trabajar en la v2 estos días y esos arreglos irán ahí).

Voy a cerrar este issue y queda #227 abierto como reporte del problema

jluisperez

comment created time in 18 days

issue openedHuemul/trae

On rejection Error.message is empty if statusText is empty

Found out about it while investigating #226

https://github.com/Huemul/trae/blob/fa83b7ffd4013f35b52447a397a8a734afa406df/lib/helpers/response-handler.js#L45

We should have a default error message.

Also, since the Error has its own .toString debugging of the response is not ideal, all the properties are not displayed. We could think about our own .toString for the ResponseError that we are going to use in v2

created time in 18 days

push eventHuemul/trae

gillchristian

commit sha 8dfc6ba600e1a9d7e031e18282aa8ac2af8bfa5f

Improve types on src/trae.ts

view details

push time in 18 days

issue commentHuemul/trae

Error

No hace falta que uses la misma API, con que se reproduzca el error usando alguna API pública seríá suficiente (aquí hay una por ejemplo). El problema es que con la información que nos has dado lástimosamente mucho no podemos hacer.

jluisperez

comment created time in 19 days

issue commentHuemul/trae

Error

Hola @jluisperez

Es difícil sin más contexto saber cuál sería el problema.

Si puedes reproducir el error en CodeSandbox quizá te podríamos ayudar.

jluisperez

comment created time in 19 days

startedgillchristian/literate-avocado

started time in 23 days

push eventgillchristian/literate-avocado

gillchristian

commit sha d4e06a314c4fa10feba38e4b1bffc695559099ce

support(repo): Add license

view details

push time in 23 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 77751e86c3ad8de6211710bacf33bba13fc6a39b

feature(ui): Footer & fixes Fix search after token showing "Loading" when no user was added Fix dispatching "SaveToken" twice (onSubmit & onClick) Search gists on "ClearToken"

view details

gillchristian

commit sha 6b17f632f3955802bc72e19be9144e041a77f60b

support(build): Build

view details

push time in 23 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 08125796c8aa42d71c538cbd26d577565bcc8b4a

fix(ui): Prevent from adding empty token

view details

gillchristian

commit sha b7008efb9e9bb37a3cebac809919f02335fe3c8c

feature(ui): Better sidebar Other improvements: cancel token editing, msg on empty page

view details

gillchristian

commit sha 2b40d414250bbd553979e4d9b6ed93f14c00ce00

support(build): Build

view details

push time in 24 days

push eventgillchristian/literate-avocado

gillchristian

commit sha fc4ec45ac0f99518101a706d7012eb1a0c711551

feature(ui): Sidebar toggle placement Also some simple responsiveness improvements

view details

gillchristian

commit sha 960bb62af05ce33e0d915cb91246c82bbca3fa06

feature(ui): Minor UI improvements Only allow `show files` on list Show "token" msg only after fetch Placeholder on username search field

view details

gillchristian

commit sha e8a161611651ede6a13d626894d5074633c81b91

support(build): Build

view details

push time in 24 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 7e484813649da00d1f6690a49b9d2c6d730db504

support(notes): Add improvements to notes

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 8272a3344ece6a2445b60d26ac0c22c8811690c8

support(notes): Add :bug: to notes

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha c7ff5935cd0d2c6ac6cc4a12eb643aed929302ce

support(build): Build

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 0098f6de9470adc112af381048854ab07ff25a47

feature(ui): UI improvements Also small fixes

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 0720ebf4544ee03933d507a6043153ee0d253d3e

support(build): Build

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 13ba4a066c473efea5333f77664d9b2673e227e4

feature(config): Update token handling

view details

gillchristian

commit sha e1355d86cc72bcbe6a5ede35e74d46417b86d155

fix(fetch): Fetch using username not search

view details

push time in 25 days

push eventgillchristian/literate-avocado

gillchristian

commit sha 7a5599cc6ef2572c1152efa93ca75d47548c11df

feature(app): GitHub pages build

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha 8c1df52dd1462054e7bb448b437bc8c30edeb8b1

feature(fetch): Fetch all the Gits for the user

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha 3f34057ab0e871f2893d9078f69c398f26221b1d

feature(ui): Sidebar with token field

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha 988872de7d53cb6b9317a095f9e40f9ea7daf5c3

feature(search): Add token to search private gists

view details

gillchristian

commit sha 90bd8cc562cde7a5b612135f5b5e48e89a97c506

feature(ui): Mark private ones

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha cea5f617edfb915c16b1a953a35b6d93278e5c91

feature(model): Start with no user username changed from String to Maybe String

view details

gillchristian

commit sha 13c4907bbcbe45e9898ec1be8d7de15a3d3e56e6

feature(model): Add subscription to persit username

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha ed5c7299f5743c1a6dc4983f8af8b7f0679aa5a4

support(ui): Add `Toggle Files` Also migrate to elm-css & do small refactors

view details

push time in a month

push eventgillchristian/psychic-literate

gillchristian

commit sha 7d38622ef138a4847049deb8fcd4f3e29503cb88

feature(ui): Improve view & support search

view details

push time in a month

create barnchgillchristian/psychic-literate

branch : master

created branch time in a month

created repositorygillchristian/psychic-literate

created time in a month

push eventgillchristian/fp-for-the-people-v2

gillchristian

commit sha 1d9d39731d4e9f396a3239a25339d72a93bb9712

support(slides): Typo

view details

push time in a month

push eventgillchristian/fp-for-the-people-v2

gillchristian

commit sha 56281956bdc1cf4e585dec5eba3f66728d6ceaa5

support(slides): Update snippets & solutions

view details

push time in a month

push eventgillchristian/fp-for-the-people-v2

gillchristian

commit sha 1c658fd04388d37386137ee405e3bb376b493e6c

support(slides): Update slides & styles

view details

push time in a month

PublicEvent

startedelm-in-elm/compiler

started time in a month

issue commentHuemul/trae

Headers is an empty object

Thanks for reporting.

Could you create a sandbox with reproduced case? (You can use the Vue template). This will be very helpful for us to figure out what's wrong.

rodolfomg

comment created time in a month

issue openedhousinganywhere/match

Pattern match on tuples

Currently match and wildMatch support only matching one single union type.

If a match needs to be done on several types, nesting becomes very painful and requires a lot of boilerplate.

type A = 'A' | 'B' | 'C'
type F = 'F' | 'G' | 'H'

const matchTyple = ([a, f]: [A, F]) => match<A, string>({
  A: () =>
    wildMatch<F, string>({
      F: () => 1,
      _: () => 2,
    })(f),
  B: () =>
    wildMatch<F, string>({
      G: () => 3,
      _: () => 4,
    })(f),
  C: () =>
    wildMatch<F, string>({
      H: () => 5,
      _: () => 6,
    })(f),
})(a)

Here is how we would write that in Haskell

data A = A | B | C
data F = F | G | H

-- pattern match using `case x of`
matchTyple :: A -> F -> Int
matchTyple a f =
  case (a, f) of
    (A, F) -> 1
    (A, _) -> 2
    (B, G) -> 3
    (B, _) -> 4
    (C, H) -> 5
    (C, _) -> 6

-- pattern match on the function arguments
-- it doesn't need to be a tuple, but it's the easiest way to port to TS (I guess)
matchTyple' :: (A, F) -> Int
matchTyple' (A, F) = 1
matchTyple' (A, _) = 2
matchTyple' (B, G) = 3
matchTyple' (B, _) = 4
matchTyple' (C, H) = 5
matchTyple' (C, _) = 6

And to show a somehow more similar syntax to TS/JS, here's Reason version:

type a =
  | A
  | B
  | C;

type f =
  | F
  | G
  | H;

let matchType = (a, f) => 
  switch((a, f)) {
  | (A, F) => 1
  | (A, _) => 2
  | (B, G) => 3
  | (B, _) => 4
  | (C, H) => 5
  | (C, _) => 6
  };

Finding a way to match on tuples would indeed reduce a lot the boilerplate.

I'm not sure yet how to handle a few things regarding the implementation and API I have in mind, and also don't know which one is the best API.

Would be something like this

// `matchMany` or `matchTuple` ? or other ?
import  { matchMany, catchAll as _ } from '@housinganywhere/match'

type A = 'A' | 'B' | 'C'
type F = 'F' | 'G' | 'H'

type ToMatch = [A, F] // would most of the time be defined in line

matchMany<ToMatch, number>(
  [['A', 'F'], () => 1],
  [['A', _],   () => 2],
  [['B', 'G'], () => 3],
  [['B', _],   () => 4],
  [['C', 'H'], () => 5],
  [['C', _],   () => 6],
)('A', 'F') // 1

const isAF = matchMany<ToMatch, boolean>(
  [['A', 'F'], () => true],
  [[_, _],     () => false],
)

isAF('A', 'F') // true
isAF('B', 'F') // false

matchMany accepts a rest param, each one is a tuple of the ToMatch tuple and the function that is going to be used in case of the match.

Is this a good API? Any ideas for something better?

What needs to be solved:

  • Constrain the first type parameter to be a tuple
  • From that type parameter be able to infer the rest of the types

Considerations:

  • Now match is exhaustive, for this tuple match it's not possible (not that I know off with current state of TS). Should be handle the error or find a way to at least get one match?
  • Examples show a two items tuple, it should work for any tuple. But we could maybe hardcode it for 2, 3 and 4 (or 5?) if it's easier than for all.
  • How to type the catchAll, we could use any but doesn't feel like good idea 😕

created time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha a02edd75117f77fd737a5a9e1f014649634dea0b

Fix/add tests & refactor

view details

push time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha fb06974785c5b570d2c9ab1c77cd6cd3390e62fa

Fix up/down migrations

view details

gillchristian

commit sha bab497d36aa3c0a1baffb2859c089e3689e97560

Fix sql files

view details

push time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha 3bc558659ccc95566ed7bf9decedddaae6ad0a1e

Add testing workshop repo link

view details

push time in 2 months

startedarthurxavierx/dotfiles

started time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha 0dfe97bb3de784b32ee7502e24d69ea1617cb495

Update linear-types notes

view details

push time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha d5e97dae03c1b41bfc4991568a673c8cdc32ab08

Add purescript notes

view details

gillchristian

commit sha f554ea46660eba2045f2529b0cd22cb4d8308c08

Add Krzysztof notes on linear types

view details

gillchristian

commit sha 2cee2f4ada56d5a12377e67b572bcfbecaa0436d

Update excersises.md & code

view details

gillchristian

commit sha 1f0ea0b9afd881cefc5c9c2d9ad8dbceacd079f1

Get code from repo

view details

gillchristian

commit sha 8e419581c2c576fe783fea286daa02acfe119613

Update DSLs notes

view details

gillchristian

commit sha 064879efaff4a50e70bcc300b9dfb7c77b20c064

Update boring-haskell project [WIP]

view details

push time in 2 months

issue commentjxnblk/mdx-deck

PDF export

Doesn't work for me either, tried @filoxo suggestion but still same error

Aetet

comment created time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha a02ae253632155c1b3899425678c3821548c66a5

Add type-safe-embedded-dsls/

view details

gillchristian

commit sha b32d8f8b1b51e34a2909bfa3e493177a744eac1a

Update linear-types notes

view details

push time in 2 months

push eventgillchristian/monadic.party

gillchristian

commit sha d4c0ae1b7b1a978e0da2ceabe5cc2cbe7b52309f

Add readme.md

view details

push time in 2 months

create barnchgillchristian/monadic.party

branch : master

created branch time in 2 months

created repositorygillchristian/monadic.party

https://monadic.party

created time in 2 months

startedSchniz/migratype

started time in 2 months

push eventgillchristian/vigilant-engine

gillchristian

commit sha 9531aa8d10d83bf9a82ac68d2c924cf416f0a0ef

support(matchers): Update matchers

view details

push time in 2 months

pull request commenthousinganywhere/safe-redux

feature(types): Add Handler type

If you open an issue explaining a bit more we can discuss there.

gillchristian

comment created time in 2 months

pull request commenthousinganywhere/safe-redux

feature(types): Add Handler type

Released 89c3f0e37ebf61d759d8ed499f8bc2188fef2595

gillchristian

comment created time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha 89c3f0e37ebf61d759d8ed499f8bc2188fef2595

v1.2.0

view details

push time in 2 months

created taghousinganywhere/safe-redux

tagv1.2.0

Create and handle safely typed actions

created time in 2 months

delete branch housinganywhere/safe-redux

delete branch : feature/handler-type

delete time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha 81d8e8186cd14fa83439ff36e6e9f8d531d63136

feature(types): Add Handler type

view details

Christian Gill

commit sha fc4aa9a01b62907d3a5a60db11c0a63f7a190d4d

Merge pull request #4 from housinganywhere/feature/handler-type feature(types): Add Handler type

view details

push time in 2 months

PR merged housinganywhere/safe-redux

feature(types): Add Handler type

Handler type can be used when you don't want to define the handlers inline

+82 -37

1 comment

4 changed files

gillchristian

pr closed time in 2 months

pull request commenthousinganywhere/safe-redux

feature(types): Add Handler type

@raybooysen added the Handler type mentioned in https://github.com/Hotell/rex-tils/issues/23#issuecomment-501621223

gillchristian

comment created time in 2 months

PR opened housinganywhere/safe-redux

Reviewers
feature(types): Add Handler type

Handler type can be used when you don't want to define the handlers inline

+82 -37

0 comment

4 changed files

pr created time in 2 months

create barnchhousinganywhere/safe-redux

branch : feature/handler-type

created branch time in 2 months

issue commentHotell/rex-tils

Proposal implementation of handleActions

Thanks will give it a try. Checking your code's TS, there is still the error with the handler object. How are you disabling this error?

I found out about the error when you pointed it out, it's not shown in my editor but it is on the playground. Probably because of a different TS config.

Screenshot from 2019-06-13 09-45-35

Screenshot from 2019-06-13 09-46-34

BTW, none of this is an indictment on your code, I've just been grappling with the same sort of problem trying to ensure that all our reducers pick up the changes to actions.

Of course :tada:


I've been using the handlers inline all the time, so I never had the need, but it really makes sense to extract them. Found a way to do it with ActionsOfType. It's a bit verbose on the types, so I personally prefer the handlers inline. But hey, it's possible :tada:

type Handler<State, ActionType extends string, Actions> = 
  (s: State, a: ActionsOfType<Actions, ActionType>) => State

const barHandler: Handler<State, 'bar', Actions> =
  (s, { payload }) => ({n: s.n + payload})

handleActions<State, Types, Actions>(
    {
        foo: (s) => ({n: s.n + 1}),
        bar: barHandler,
    },
    { n: 0},
)

Updated the playground: http://bit.ly/2F1V0Gz

And I think I will add it to the library when I get some time.

gillchristian

comment created time in 2 months

issue commentHotell/rex-tils

Proposal implementation of handleActions

@raybooysen even with that any there the inference works when you use handleActions.

Check it out here: http://bit.ly/2WAWFZw

Try changing the handlers you pass to handleActions or adding more cases to the Types (line 70), also check how handleActions infers actions of each handler having a payload or not.

It'd be great if we could fix this error but I don't think it changes the result.

Also, I published what's in the playground as a separate pacakge https://github.com/housinganywhere/safe-redux

gillchristian

comment created time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha 6534d0be605ae9bca81d551d53df0e7ee994f805

v1.1.1

view details

push time in 2 months

created taghousinganywhere/safe-redux

tagv1.1.1

Create and handle safely typed actions

created time in 2 months

delete branch housinganywhere/safe-redux

delete branch : support/upgrade-dependencies

delete time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha dfc0f376fe4cffe6a0a920fa37b37ecc2a7fbce2

support(dependencies): Upgrade dependencies

view details

Christian Gill

commit sha cf210a4e18759136df3c51652e53591e83eb5d14

support(dependencies): Upgrade dependencies (#3) support(dependencies): Upgrade dependencies

view details

push time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha dfc0f376fe4cffe6a0a920fa37b37ecc2a7fbce2

support(dependencies): Upgrade dependencies

view details

push time in 2 months

push eventhousinganywhere/safe-redux

gillchristian

commit sha 8d2b2ee789cc5682acb83db1b52a25fcfad2e353

support(dependencies): Upgrade dependencies

view details

push time in 2 months

create barnchhousinganywhere/safe-redux

branch : support/upgrade-dependencies

created branch time in 2 months

push eventgillchristian/legendary-adventure

Christian Gill

commit sha 31132c926397fbcd60f2998aadb4c3e3f72c775c

Create README.md

view details

push time in 2 months

push eventgillchristian/legendary-adventure

Christian Gill

commit sha d51f396842b8794f1df29796e7f552f73abba14c

Add never, object & basic type inference sections

view details

push time in 2 months

create barnchgillchristian/legendary-adventure

branch : master

created branch time in 2 months

created repositorygillchristian/legendary-adventure

A TS tutorial with no guarantees

created time in 2 months

PR closed trustedanalytics/console

Fix images width and tags line wrap.
  • Fix the issue with images width on both Instances & Marketplace views.
  • Make services tags on the Marketplace view wrap into a new line.

NOTE: I was not able to run it locally due to the project's dependencies. Changes were tested on Chrome Dev Tools and added to the corresponding SCSS files.

+17 -1

1 comment

1 changed file

gillchristian

pr closed time in 3 months

PR closed up-for-grabs/up-for-grabs.net

Add trae to projects needs tasks

This PR adds trae to the projects.

+12 -0

0 comment

1 changed file

gillchristian

pr closed time in 3 months

startedsras/elminator

started time in 3 months

startedxcambar/purs

started time in 3 months

startedjkachmar/scale-by-the-bay-2018

started time in 3 months

startedreact-monaco-editor/react-monaco-editor

started time in 3 months

startedcohomolo-gy/haskell-resources

started time in 3 months

startedjoonhocho/tsdef

started time in 3 months

startedjaredly/milk

started time in 3 months

fork gillchristian/material-ui

React components for faster and easier web development. Build your own design system, or start with Material Design.

https://material-ui.com/

fork in 3 months

more