All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.utils.createSubscription.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"createSubscription.js","names":["_actioncable","require","_general","getWebsocketURL","_document$querySelect","websocketURL","document","querySelector","content","buildUrl","subdomain","globalProps","organization","consumer","createConsumer","createSubscription","exports","channelName","callbacks","subscriptions","create"],"sources":["../../../src/utils/createSubscription.js"],"sourcesContent":["import { createConsumer } from \"@rails/actioncable\";\nimport { buildUrl } from \"utils/general\";\n\nconst getWebsocketURL = () => {\n  const websocketURL = document.querySelector(\n    'meta[name=\"action-cable-url\"]'\n  )?.content;\n\n  return buildUrl(websocketURL, {\n    subdomain: globalProps.organization.subdomain,\n  });\n};\n\nconst consumer = createConsumer(getWebsocketURL);\n\nexport const createSubscription = (channelName, callbacks) =>\n  consumer.subscriptions.create(channelName, callbacks);\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAME,eAAe,GAAG,SAAlBA,eAAeA,CAAA,EAAS;EAAA,IAAAC,qBAAA;EAC5B,IAAMC,YAAY,IAAAD,qBAAA,GAAGE,QAAQ,CAACC,aAAa,CACzC,+BACF,CAAC,cAAAH,qBAAA,uBAFoBA,qBAAA,CAElBI,OAAO;EAEV,OAAO,IAAAC,iBAAQ,EAACJ,YAAY,EAAE;IAC5BK,SAAS,EAAEC,WAAW,CAACC,YAAY,CAACF;EACtC,CAAC,CAAC;AACJ,CAAC;AAED,IAAMG,QAAQ,GAAG,IAAAC,2BAAc,EAACX,eAAe,CAAC;AAEzC,IAAMY,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,SAArBA,kBAAkBA,CAAIE,WAAW,EAAEC,SAAS;EAAA,OACvDL,QAAQ,CAACM,aAAa,CAACC,MAAM,CAACH,WAAW,EAAEC,SAAS,CAAC;AAAA","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy