2.9.85 • Published 10 months ago

@erboladaiorg/quasi-reiciendis v2.9.85

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

npm version

Resilient Websockets

  • automatic retries when the message cannot be sent (e.g. when the connection is lost)
  • ping/pong to keep the connection alive

Installation

npm install @erboladaiorg/quasi-reiciendis

OR

yarn add @erboladaiorg/quasi-reiciendis

OR

pnpm add @erboladaiorg/quasi-reiciendis

Usage

import { ResilientWS } from '@erboladaiorg/quasi-reiciendis'

ResilientWS.create({
  url: '',
  onConnectCallback: () => {
    console.log(`Wow this is a websocket connection!`)
  },
  onDisconnectCallback: () => {
    console.log(`Wow this is a websocket disconnection!`)
  },
  onMessageCallback: (message) => {
    console.log(`Wow this is a websocket message!`, message)
  },
  onErrorCallback: (error) => {
    console.log(`Wow this is a websocket error!`, error)
  },
})

ResilientWS maintains a single instance. So you can import it anywhere and use it.

import { ResilientWS } from '@erboladaiorg/quasi-reiciendis'

const ws = ResilientWS.getInstance()

ws.send({
    message: 'Hello World!'
    attempt: 0,
    forceReconnect: false,
})

Ping/Pong

By default, ping/pong is disabled. You can enable it by passing the config for ping/pong when creating your ResilientWS instance.

import { ResilientWS } from '@erboladaiorg/quasi-reiciendis'

ResilientWS.create({
  ...config,
  pingPongSettings: {
    enabled: true
    pingInterval: 10000,
    pingMessage: 'ping',
  },
})
higher-orderinstallgetOwnPropertyDescriptorhardlinksURLdeepcopycolumnstacithandlerpushArray.prototype.filterdeep-cloneramdaECMAScript 2021ec2ES2020circularwritebinarytrimLeftbyteLengthsqslogbinariesjoiacornformatECMAScriptsimpledbvarses-shim APImruloggingexecmockingReactiveExtensionsvalidatorvariablesbindserializertextclass-validatorlengthargvwafeventEmitterreal-timeoptimizerentriesfastjestnodeJSONdefinePropertygetPrototypeOfobjinvariantregular-expressionlintflattenchaiES5has-owntypeasserteast-asian-widthjson-schemaawesomesaucefindLastIndexbrowserlist.envstringifyprivatesomeTypeBoxSetstructuredClonedeepcloneeslintpluginBigInt64ArrayescapeRegExp#flagsdomfast-clonereducergradients csspluginECMAScript 5randomESnextsuperagentinternal slotmobileresolvei18nansidiffES2018stylingfull-widthruntimezeroiamassertssortedgitignoreredux-toolkitvariables in csslanguagedotenvflagconsolefastcloneflatMapprivate datavalidationdragyamlspecfpsletECMAScript 7purebannerqsRegExp.prototype.flagswalkcloudsearchtoSortedtesterWebSocketbrowserslistwindowcss lessnumbernativeWeakMapclientbusyjQueryless.jscolumncontainstypedmkdirpsyntaxerrorcollection.es6internalbinemitObservablesemrObject.valuesES2021ECMAScript 2016installersignedproxyconsumeinputsnstelephonegdprparserconcattslibsafesetnopefilterWeakSetECMAScript 3AsyncIteratorquerystringdescriptionwarningsubprocesssetterslotfunction.lengtheverypoint-freeconfigurableecmascriptpackagesmake dirjwtsetImmediatereadableUnderscorespringglobal this valuetypanionwgetdatechromiumlinkArray.prototype.flattenUint32Arrayclonepersistentes-shimsUint8ArraycensorglobalsHyBiobjecttoobjectio-tsshellshamlinuxmergeArray.prototype.includesserializemovees7assignterminalthreetouchwaitES2017certificatesvisualelbString.prototype.trimReflect.getPrototypeOfmkdirlesscssgetes2017core-jsdependenciessymbolsmatchAllcommandershrinkwrapdefineroute53helpersmacosspawnoptimistsignalglobtoStringTagreact-component_.extendbcryptfindtoArrayutil.inspectidlepostcssfigletvestsyntaxcryptonegative zerotraversepackage managerserverpredictableebsboundString.prototype.matchAllinieloadbalancingRxJSjsdiffignoreES2015cryptbrowsererror-handlingintrinsicfunctionsdeterministicbabeltrimStartmodulematcheskinesisnegativeMapfunctionalECMAScript 2020mixinsregular expressionscheme-validation[[Prototype]]tddYAMLtestES2022ruleseslintconfiggesturesuninstallSymboldeep-copymetadatapolyfilloffsetvarreduxreplaytypeofdependency managerreact-hook-formUint8ClampedArrayback-endimmutableastweaksetpatchl10nhashArray.prototype.findLastIndextransportclassesequalityswfES2019cloudfrontstyleguidecompare3dfront-endrobustmakehandlersArrayBuffer.prototype.sliceES7environmentsiterateauthenticationdayjsStyleSheetindicatorencryptionRFC-6455dataviewES3TypeScriptefficientsigtermponyfillvalidairbnbcreateES2016byterdsquerystyled-componentscurlpackage.jsontypeerrordom-testing-libraryjson-schema-validatorcheckcollectionsymlinkexpressionpipeprocessargsgroupspinnerslocaluploadsharedarraybufferlrufetch0datakeyscodestakeflagsObject.keyseslint-pluginstringsequenceless cssvalidateECMAScript 2018arraysapollostatenpmignore-0Int8ArraycharactercallbeanstalkstableSymbol.toStringTagUint16Arrayframeres-abstractapiaccessibilityhasOwnPropertycloudformationstreaminterruptsjson-schema-validationequalglacierlivePushtty256fast-copyartargumentexecutetc39fromfast-deep-copyfullarktypeprunesameValueZeroviewposejsonschemacoerciblees2015whatwgfluxoutputagentcloudwatchsetPrototypeOfformEStypescriptdirstylescallbindextrafsprotocol-buffersmanagerreadablestreamcall-bindFloat32ArrayprogressquotecolorArray.prototype.flatkoreantranspileObject.isspeedconcatMapstatelessWebSocketsidentifiersArray.prototype.findLastJSON-Schemaperformanceinspectnamesdropes8waapishimECMAScript 2022StreamsjsworkerpropertiesparsebyteOffsetfileArraySystem.globalcommandECMAScript 2019queueMicrotaskreact posejsxconstsettingsObject.definePropertyObject.fromEntriesdynamodbjsdompreprocessoruser-streamsECMAScript 2015espreepropertylistenersgradients css3importdatastructureworkspace:*Object.assignimportexportsesmocknodejsCSSutilitiescacheprototypeless compilerexittranspilercolorsschemerapidjapaneseroutingcss-in-jsinferenceamazonphoneises6es5httpsArrayBufferlastObject.entriesconfigfnmatch$.extendutilsopensslcompile lessnpmauthObservablefindLasthelperreactInt32Arrayshebangtscssimmerreact animation
2.9.85

10 months ago

2.9.84

10 months ago

2.9.83

10 months ago

2.9.82

10 months ago

2.9.81

10 months ago

2.8.81

11 months ago

2.8.80

11 months ago

2.8.79

11 months ago

1.8.79

11 months ago

1.8.78

11 months ago

1.7.78

11 months ago

1.7.77

11 months ago

1.6.77

11 months ago

1.6.76

11 months ago

1.6.75

11 months ago

1.6.74

11 months ago

1.6.73

11 months ago

1.6.72

11 months ago

1.6.71

11 months ago

1.6.70

11 months ago

1.6.69

11 months ago

1.6.68

11 months ago

1.6.67

11 months ago

1.6.66

11 months ago

1.6.65

11 months ago

1.6.64

11 months ago

1.6.63

11 months ago

1.5.63

11 months ago

1.4.63

11 months ago

1.4.62

11 months ago

1.4.61

11 months ago

1.4.60

11 months ago

1.4.59

11 months ago

1.4.58

11 months ago

1.4.57

11 months ago

1.4.56

12 months ago

1.4.55

12 months ago

1.4.54

12 months ago

1.4.53

12 months ago

1.4.52

12 months ago

1.4.51

12 months ago

1.4.50

12 months ago

1.4.49

12 months ago

1.4.48

12 months ago

1.4.47

12 months ago

1.3.47

12 months ago

1.2.47

12 months ago

1.2.46

12 months ago

1.2.45

12 months ago

1.2.44

12 months ago

1.2.43

12 months ago

1.2.42

12 months ago

1.2.41

12 months ago

1.2.40

12 months ago

1.2.39

12 months ago

1.2.38

1 year ago

1.2.37

1 year ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago