-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new npm release, bump version, breaking: refactore datastore depeneci…
…es, fix $not, await call and call result bugs in data store, fix ipfs handler aborting before cache put finished, support for non service worker setups, working sveltekit support, breaking: auto add falcor tags on empty path tags, initial ssr support and precache, HMR support, fix autowrapper for path results,
- Loading branch information
Showing
29 changed files
with
30,505 additions
and
7,459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
const empty = { | ||
dispose: function () {} | ||
} | ||
function ImmediateScheduler () {} | ||
ImmediateScheduler.prototype.schedule = function schedule (action) { | ||
action() | ||
return empty | ||
} | ||
ImmediateScheduler.prototype.scheduleWithState = function scheduleWithState (state, action) { | ||
action(this, state) | ||
return empty | ||
} | ||
|
||
|
||
function TimeoutScheduler (delay = 1) { | ||
this.delay = delay | ||
} | ||
const TimerDisposable = function TimerDisposable (id) { | ||
this.id = id | ||
this.disposed = false | ||
} | ||
TimeoutScheduler.prototype.schedule = function schedule (action) { | ||
const id = setTimeout(action, this.delay) | ||
return new TimerDisposable(id) | ||
} | ||
TimeoutScheduler.prototype.scheduleWithState = function scheduleWithState (state, action) { | ||
const self = this | ||
const id = setTimeout(function () { | ||
action(self, state) | ||
}, this.delay) | ||
|
||
return new TimerDisposable(id) | ||
} | ||
TimerDisposable.prototype.dispose = function () { | ||
if (this.disposed) { | ||
return | ||
} | ||
clearTimeout(this.id) | ||
this.disposed = true | ||
} | ||
|
||
/* eslint-disable functional/no-this-expression, functional/no-class */ | ||
class FrameScheduler { | ||
schedule (action) { | ||
let id = requestAnimationFrame(action) | ||
|
||
return { | ||
dispose: () => { | ||
if (id) { | ||
cancelAnimationFrame(id) | ||
id = null | ||
} | ||
} | ||
} | ||
} | ||
scheduleWithState (state, action) { | ||
const self = this | ||
let id = requestAnimationFrame(() => { | ||
action(self, state) | ||
}) | ||
return { | ||
dispose: () => { | ||
if (id) { | ||
cancelAnimationFrame(id) | ||
id = null | ||
} | ||
} | ||
} | ||
} | ||
} | ||
/* eslint-enable functional/no-this-expression, functional/no-class */ | ||
|
||
export { ImmediateScheduler, TimeoutScheduler, FrameScheduler } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.