create-qwik
Advanced tools
Comparing version 0.0.16 to 0.0.17-0-dev20220303165846
{ | ||
"name": "create-qwik", | ||
"version": "0.0.16", | ||
"version": "0.0.17-0-dev20220303165846", | ||
"description": "Interactive CLI and API for generating Qwik projects.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -6,3 +6,3 @@ { | ||
"scripts": { | ||
"typecheck": "npx tsc --noEmit", | ||
"typecheck": "tsc --noEmit", | ||
"build": "npm run typecheck && npm run build.client && npm run build.server", | ||
@@ -18,3 +18,3 @@ "build.client": "vite build", | ||
"@types/node": "17.0.17", | ||
"@builder.io/qwik": "0.0.16", | ||
"@builder.io/qwik": "0.0.17-0-dev20220303165846", | ||
"typescript": "4.5.5", | ||
@@ -21,0 +21,0 @@ "vite": "2.8.0" |
@@ -15,31 +15,6 @@ //////////////////////////////////////////////////////////////////////// | ||
//////////////////////////////////////////////////////////////////////// | ||
// Todo Application State Mutation Functions | ||
//////////////////////////////////////////////////////////////////////// | ||
export type FilterStates = 'all' | 'active' | 'completed'; | ||
export function addItem(todos: Todos, text: string) { | ||
todos.items.push({ completed: false, title: text }); | ||
updateFilter(todos); | ||
} | ||
export const FilterStates: FilterStates[] = ['all', 'active', 'completed']; | ||
export function removeItem(todos: Todos, todoItem: TodoItem) { | ||
todos.items = todos.items.filter((i) => i != todoItem); | ||
updateFilter(todos); | ||
} | ||
export function toggleItem(todos: Todos, todoItem: TodoItem) { | ||
todoItem.completed = !todoItem.completed; | ||
updateFilter(todos); | ||
} | ||
export function clearCompleted(todos: Todos) { | ||
todos.items = todos.items.filter(FILTERS.active); | ||
updateFilter(todos); | ||
} | ||
//////////////////////////////////////////////////////////////////////// | ||
// Todo Application State Filter Functions | ||
//////////////////////////////////////////////////////////////////////// | ||
export type FilterStates = 'all' | 'active' | 'completed'; | ||
export const FilterStates: FilterStates[] = ['all', 'active', 'completed']; | ||
export const FILTERS = { | ||
@@ -50,15 +25,1 @@ all: () => true, | ||
}; | ||
export function updateFilter(todos: Todos, filter?: FilterStates) { | ||
if (filter) { | ||
todos.filter = filter.toLowerCase() as any; | ||
} | ||
} | ||
export function getFilteredItems(todos: Todos): TodoItem[] { | ||
return todos.items.filter(FILTERS[todos.filter]); | ||
} | ||
export function getFilteredCount(todos: Todos) { | ||
return getFilteredItems(todos).filter(FILTERS.active).length; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
137260
1286