How to use the piral-core.withKey function in piral-core

To help you get started, we’ve selected a few piral-core 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 smapiot / piral / src / packages / piral-feeds / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    feeds: withKey(state.feeds, id, {
      data: undefined,
      error: undefined,
      loaded: false,
      loading: true,
    }),
  }));
github smapiot / piral / src / packages / piral-search / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    registry: {
      ...state.registry,
      searchProviders: withKey(state.registry.searchProviders, name, value),
    },
  }));
}
github smapiot / piral / src / packages / piral-modals / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    registry: {
      ...state.registry,
      modals: withKey(state.registry.modals, name, value),
    },
  }));
}
github smapiot / piral / src / packages / piral-feeds / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    feeds: withKey(state.feeds, id, {
      loading: false,
      loaded: true,
      error,
      data,
    }),
  }));
}
github smapiot / piral / src / packages / piral-menu / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    registry: {
      ...state.registry,
      menuItems: withKey(state.registry.menuItems, name, value),
    },
  }));
}
github smapiot / piral / src / packages / piral-dashboard / src / actions.ts View on Github external
swap(ctx, state => ({
    ...state,
    registry: {
      ...state.registry,
      tiles: withKey(state.registry.tiles, name, value),
    },
  }));
}