estrattonbailey / evx

Handy dandy persistent-state pub/sub with multi, wildcard, and single-property subscriptions.
25 stars 2 forks source link

Code Editors Expect Transients #18

Open JamiesonRoberts opened 8 months ago

JamiesonRoberts commented 8 months ago

Hey @estrattonbailey!

Something I've noticed in working with Pico (and by extension EVX), is that code editors appear to be flagging that the emit (https://github.com/estrattonbailey/evx/blob/5f83e9ca6ad417eec343e62cd64469bb40b63013/index.js#L47C1-L47C33) needs a 3rd property for the transients, even though it operates just fine without it.

Thoughts on adding a default value for transients? Something like

emit (ev, data, transient = null) {

The other option might be to convert it to TS so that that parameter can be flagged as optional, but that's probably overkill.

estrattonbailey commented 8 months ago

Hey! Sounds reasonable, feel free to PR, I'm happy to review and approve. A TS rewrite is probably simple enough too, but would require new tooling, etc, so totally get if that's a little much to do right now.