Skip to content

Correct way to get ts type of store, historyPlugin #315

Answered by leon
leon asked this question in Q&A
Discussion options

You must be logged in to vote

The answer I was looking for is:

import { createStore, StoreDef, StoreValue } from '@ngneat/elf'
import { withEntities, withActiveId } from '@ngneat/elf-entities'

const myStore = createStore(
  { name: 'mystore' },
  withEntities<T>(),
  withActiveId()
)

type MyStore = StoreDef<StoreValue<typeof myStore>>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by leon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants