Skip to content

Commit

Permalink
feat: scaling helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 committed Aug 12, 2022
1 parent f79cdef commit c92445e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,39 @@ export function createStore<TState, TFreezeInitialState extends boolean, TMutati
return store;
}

/** This function does nothing more than typing your mutation. */
export function createMutation<TState, TMutation extends Mutation<TState>>(
_initialState: TState,
mutation: TMutation,
): TMutation {
return mutation;
}

/** This function does nothing more than typing your mutations. */
export function createMutations<TState, TMutations extends Mutations<TState>>(
_initialState: TState,
mutations: TMutations,
): TMutations {
return mutations;
}

/** This function does nothing more than typing your mutation. */
export function createAction<TState, TMutations, TAction extends Action<TState, TMutations>>(
_initialState: TState,
_mutations: TMutations,
action: TAction,
): TAction {
return action;
}

/** This function does nothing more than typing your actions. */
export function createActions<TState, TMutations, TActions extends Actions<TState, TMutations>>(
_initialState: TState,
_mutations: TMutations,
actions: TActions,
): TActions {
return actions;
}

export const riux = createStore;
export default createStore;

0 comments on commit c92445e

Please sign in to comment.