How can I programmatically get the id of the current page?

I’m trying to get data associated with the current page.
ID is a good start, so I’m trying to get that.

The tutorial has this passage:

“We first get the data about the URL from state.source.data. Then armed with the information provided there, crucially the content type and the id (though we can also check whether the data is ready for retrieval with isReady, amongst other things), we can retrieve the actual content”.

The tutorial goes on to describe how to get data once you have the page id.

The problem is - the tutorial doesn’t describe how to get the page id in the first place.

So yeah - how do I actually get the id?

whenever your route changes, frontity automatically calls actions.source.fetch() to populate state with current page’s data

you can then access this data using state.source.get(state.router.link), it returns an object with current’s page infos such as id, isFetching, isReady, type and so on