How to use the @datorama/akita.guid function in @datorama/akita

To help you get started, we’ve selected a few @datorama/akita examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tanepiper / ngx-tinynodes / libs / ngx-editorjs / ngx-editorjs-demo / src / lib / store / pages / pages.service.ts View on Github external
upsert(page: Page) {
    if (!page.id) page.id = guid();
    this.store.upsert(page.id, page);
  }
github tanepiper / ngx-tinynodes / libs / ngx-editorjs / ngx-editorjs-demo / src / lib / store / pages / pages.service.ts View on Github external
add(page?: Page) {
    const newPage: Page = {
      id: guid(),
      pageTitle: 'New Page',
      pageTags: [],
      blocks: [],
      ...page
    };
    this.store.add(newPage);
  }
github datorama / akita / examples / svelte / src / state / todos.service.js View on Github external
export async function addTodo(title) {
  const todo = {
    title,
    completed: false,
  };
  const idFromServer = await Promise.resolve(guid());
  todosStore.add({
    id: idFromServer,
    ...todo
  });
}
github datorama / akita / angular / playground / src / app / todos-app / state / todo.model.ts View on Github external
export function createTodo(title: Todo['title']) {
  return {
    id: guid(),
    title,
    completed: false
  } as Todo;
}