Are the .on's not emitting?
See original GitHub issueit seems like the machine.on(‘x’, cb) things aren’t happening for me
var nanostate = require('nanostate')
var machine = nanostate('idle', {
idle: { click: 'loading' },
loading: { resolve: 'data', reject: 'error' },
data: { click: 'loading' },
error: { click: 'loading' }
})
console.log(machine.state)
machine.emit('click')
console.log(machine.state)
machine.on('idle', () => console.log('on idle'))
machine.on('loading', () => console.log('on loading'))
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
About ONS business surveys - Office for National Statistics
No. Although ONS appreciated the time and effort you take to complete our surveys, it is unable to offer payment as completing the...
Read more >Does the Product Emit Radiation? - FDA
Most radiation-emitting products are not considered to be medical devices. However, if you make any medical claims, your product is a ...
Read more >An update on ONS's plans to transform the population and ...
Administrative data are a rich source of data and have the potential to transform the way in which we gather demographic data.
Read more >Effects of poverty on mental health in the UK working-age ...
AbstractBackground. Addressing poverty through taxation or welfare policies is likely important for public mental health; however, ...
Read more >Universal Credit statistics, 29 April 2013 to 13 January 2022
Not all new claims go on to “start” on Universal Credit ... The number of people on Universal Credit who were not working...
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
thanks for working with my bad example where i send events before i register listeners for them 😅
okay so the events -are- being emitted but we are emitting the original event name (ie: ‘click’), not the state name. i checked the docs and it seems to suggest that the latter is the expected behavior. gonna make a quick pr.