0.2.0 • Published 5 years ago
optimistic-updates v0.2.0
optimistic-updates
The library that allows you to stop worrying about Promises.
Example
import { makeUpdater } from 'optimistic-updates';
const updater = makeUpdater(
performCreate,
performUpdate,
performDelete,
initialBackendIds,
notify,
);
// performCreate() will be fired
updater.create(123, {
width: 20,
height: 40,
name: 'Foo',
});
// performUpdate() will NOT be fired
updater.update(123, {
width: 45,
});
// performDelete() will be fired
updater.remove(123);