Function: create()
create(
title
,action
):Command
Creates a basic reversible command.
Example:
function changeFoo(store: FooStore, foo: Foo): Command {
return Command.create('Set foo', () => {
const previous = store.foo;
store.setFoo(foo);
return changeFoo(store, previous);
});
}
Parameters
Parameter | Type |
---|---|
|
|
|