nanostate
nanostate copied to clipboard
Implementation of History API
I was wondering what is the join
function used in History code sample:
var nanostate = require('nanostate')
var machine = nanostate('cash', {
cash: { check: 'check' },
check: { cash: 'cash' }
})
machine.join('next', nanostate('review', {
review: { previous: '$history' }
}))
What exactly is next
and what it changes in machine
object?
Ok, I just watched the talk from David Khourshid about FSM and at https://youtu.be/VU1NKX6Qkxc?t=22m23s he spoke about History states. Is it right to assume that as an answer?
I believe the history example here is based on the one in that talk, but yet to be implemented.
@brunoskonrad yep, history states is exactly that. To be fair, this has felt as the most odd part of the API, so suggestions on how to improve it would be very welcome!