mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 22:55:59 +00:00
save dialog
This commit is contained in:
11
packages/web/src/utility/createReducer.ts
Normal file
11
packages/web/src/utility/createReducer.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export default function createReducer(reducer, initialState): any {
|
||||
const state = writable(initialState);
|
||||
|
||||
function dispatch(action) {
|
||||
state.update(x => reducer(x, action));
|
||||
}
|
||||
|
||||
return [state, dispatch];
|
||||
}
|
||||
Reference in New Issue
Block a user