explicit signals connect in view package
See original GitHub issueI don’t like that we expose all signals to each cerebral connected component. Also we can’t use constants to define signal path. Here is proposal:
connect({
foo: 'some.state.path', // exist
bar: props => `some.entity.${byKey}`, // exist
baz: Computed(), // exist
signals: { // proposal
smthHappened: 'path.to.smthHappened'
}
}, function Component ({ foo, bar, baz, signals }) {
return (
<div>
<li>{foo}</li>
<li>{bar}</li>
<li>{baz}</li>
<button onClick={e => signals.smthHappened()}>
</div>
)
})
or
connect({
foo: 'some.state.path', // exist
bar: props => `some.entity.${byKey}`, // exist
baz: Computed(), // exist
}, { // proposal
smthHappened: 'path.to.smthHappened'
}, function Component ({ foo, bar, baz, smthHappened }) {
return (
<div>
<li>{foo}</li>
<li>{bar}</li>
<li>{baz}</li>
<button onClick={e => smthHappened()}>
</div>
)
})
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:23 (23 by maintainers)
Top Results From Across the Web
Signals | Django documentation
Signals are implicit function calls which make debugging harder. If the sender and receiver of your custom signal are both within your project,...
Read more >Transport Protocol Path Signals RFC 8558
Where the endpoints desire that network elements along the path receive these signals, this document recommends explicit signals be used.
Read more >signal package - os/signal
Package signal implements access to incoming signals. ... However, some signals are explicitly unblocked: the synchronous signals, SIGILL, SIGTRAP, ...
Read more >Signals and Slots — Flow Framework 8.1.x documentation
This is the place to wire signals to slots as needed for your package. This can be done using the connect() and wire()...
Read more >How to Increase Ecommerce Conversion Rates with Signals
Common examples of explicit signals include purchases, ratings, social posts, searches, and returns (negative). Explicit signals generally ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think we are taking way too much freedom on that one 😃 Technically we need to extract signals specifically… so I still favor:
And it reads very well:
It is also similar to
connect
by Redux:Hehe, I have a tendency to stretch my opinions as far as I can 😉
But I still think namespaced is the wrong way to go. When we compare the two approaches there are more negatives on the state/signals namespace approach than extending with a second argument:
namespace negatives
extra argument negatives