Skip to content

Commit

Permalink
refactor(atom): extract IReset, ISwap from IAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 31, 2018
1 parent 035c51a commit 74ecdf1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/atom/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ export interface ReadonlyAtom<T> extends
api.IWatch<T> {
}

export interface IAtom<T> extends ReadonlyAtom<T> {
export interface IAtom<T> extends
ReadonlyAtom<T>,
IReset<T>,
ISwap<T> {
}

export interface IReset<T> {
reset(val: T): T;
}

export interface ISwap<T> {
swap(fn: SwapFn<T>, ...args: any[]): T;
}

0 comments on commit 74ecdf1

Please sign in to comment.