From 19c97e37c372f4fc60037fb4ab725ba46c1ba228 Mon Sep 17 00:00:00 2001 From: Matt Ross Date: Tue, 17 Mar 2020 16:20:28 -0400 Subject: [PATCH] refactor: Don't require `Channel.Config.t`'s `"json"` prop --- src/AmqpConnectionManager.re | 8 ++------ src/AmqpConnectionManager.rei | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/AmqpConnectionManager.re b/src/AmqpConnectionManager.re index 32a2477..f78aafa 100644 --- a/src/AmqpConnectionManager.re +++ b/src/AmqpConnectionManager.re @@ -22,11 +22,7 @@ module Channel = { [@bs.send] external nack: (t, Queue.message) => unit = "nack"; module Config = { - type nonrec t = { - . - "json": bool, - "setup": t => Js.Promise.t(unit), - }; + type nonrec t('a) = {.. "setup": t => Js.Promise.t(unit)} as 'a; }; [@bs.send] @@ -130,7 +126,7 @@ module AmqpConnectionManager = { "on"; [@bs.send] - external createChannel: (t, Channel.Config.t) => ChannelWrapper.t = + external createChannel: (t, Channel.Config.t('a)) => ChannelWrapper.t = "createChannel"; }; diff --git a/src/AmqpConnectionManager.rei b/src/AmqpConnectionManager.rei index 7ca6dba..c100423 100644 --- a/src/AmqpConnectionManager.rei +++ b/src/AmqpConnectionManager.rei @@ -20,11 +20,7 @@ module Channel: { let nack: t => nack; module Config: { - type nonrec t = { - . - "json": bool, - "setup": t => Js.Promise.t(unit), - }; + type nonrec t('a) = {.. "setup": t => Js.Promise.t(unit)} as 'a; }; let assertExchange: