Comments (3)
This is not the API. Though it works in certain cases based on they way the code is working, it was never intended that publish()
would support multiple events. It would be unsafe to add that signature because people would then rely upon unintended behaviour of the code. This is one of the good things in TypeScript is we can enforce the intent of the code.
From a code perspective, publish()
uses Evented.emit()
which uses on.emit()
which in turn uses an internal function called syntheticDispatch()
when it is not a DOM target, which does pass whatever arguments, but only under certain conditions.
Thanks for the feedback though.
from typings.
According to the API documentation:
All arguments after the first will be passed to the subscribers, so any number of arguments can be provided (not just event).
I would assume the TypeScript definitions would need to represent what the API documentation is stating.
from typings.
Yes I see that is in the source comments and there is a test for it as well, so even though the chain is rather "fragile" in my opinion of how it was delivered, it was clearly intentional.
from typings.
Related Issues (20)
- Add widget example HOT 5
- Missing Grunt task configuration options causes build to fail HOT 1
- Update "basicApp" example to include translation bundles
- Cannot find name ActiveXObject HOT 5
- Compile errors with TypeScript 2.4.1 HOT 3
- Issues with noimplicitany and dijit
- Typo in NumberFormatOptions definition HOT 1
- Module name dgrid/extensions/Dnd has incorrect case HOT 1
- Typings for dstore/Tree are missing HOT 1
- Intern and leadfoot cause error TS2307: Cannot find module 'dojo/Promise'.
- Errors with Typescript 2.6 using --strictFunctionTypes HOT 1
- Property 'inherited' does not exist on type <...> HOT 1
- Is the dojo/fx/Toggler functional? HOT 1
- ComboBox incorrectly typed
- declareDecorator does not bring along getters and setters
- dojox/widget/Standby typings are missing
- Incorrect declare typings
- EventedConstructor has two constructors of different types HOT 4
- Adding dojox/rpc/Service
- DocumentEvent - Cannot find name DocumentEvent HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typings.