Commit graph

22 commits

Author SHA1 Message Date
Isiah Meadows
90bcff0fa7
Deduplicate m.route and m.redraw logic (#2453)
- Remove appropriate route change subcriptions when a root is removed
  via `m.mount(root, null)`.
- Don't pollute `onpopstate` and friends - use standard event listeners
  instead.
- Simplify and streamline subscriptions, in preparation of adding a
  `remove` parameter to `m.mount`.
- Change the redraw internals to redraw immediately, with ability to
  cancel via returning a sentinel.
- Change `"bleeding-edge"` for `m.version` in `next` to instead just be
  the latest `m.version`. (If you're using `next`, you should know what
  you're in for.)
- Update tests to be aware of these changes. (Some were failing for
  subtle reasons.)
- Drive-by: remove some uses of `string.charAt(n)` and use `string[n]`
  instead.
2019-07-05 18:52:06 -04:00
Pierre-Yves Gerardy
b004c20f0c Make m.redraw() strictly asynchronous 2017-06-13 15:20:29 +02:00
Pierre-Yves Gerardy
f273b012c9 Add support for (m.mount + m.route) × (factory + constructible) components 2017-02-15 21:58:42 +01:00
Leo Horie
2ffd2fb7e4 throttle m.route redraws 2016-12-04 01:53:39 -05:00
Leo Horie
713c25c9c0 fix #1404 2016-12-01 01:45:07 -05:00
Leo Horie
93fba4dc1d add error message in m.mount 2016-10-27 20:28:33 -04:00
Leo Horie
66aa9ce818 alignment 2016-10-18 10:15:08 -04:00
Pierre-Yves Gerardy
747f2b2847 Move otherwise redundant unsubscription 2016-08-17 16:22:44 +02:00
Pierre-Yves Gerardy
aca514eba7 Better cleanup when unmounting 2016-08-17 15:20:19 +02:00
Leo Horie
0de67f3ac9 re-add line removed by mistake 2016-08-17 09:14:46 -04:00
Leo Horie
80c25e3809 rename routeresolver methods to {onmatch,view}
expose some piecemeal modules
rename internal xhr to request
mirror internal stream api to match public api
2016-08-17 00:10:47 -04:00
Pat Cavit
c92e24b7e1 render clears non-mithril dom nodes 2016-08-05 14:15:25 -07:00
Pierre-Yves Gerardy
ccc2e1c85d Unmount and cleanly refresh mount points. 2016-08-05 00:55:18 +02:00
impinball
b4fb21475c Add editorconfig, resolve differences
This includes newlines, tabs, among other things.
2016-06-18 03:22:12 -04:00
Leo Horie
9b602edf4e create only one renderer 2016-05-21 00:59:33 -04:00
Leo Horie
0005cf26ee refactor redraw into pubsub and autoredraw
- pubsub is a basic pubsub impl
- autoredraw is glue code to register callback to pubsub and onevent

moved e.redraw to autoredraw
2016-05-21 00:37:34 -04:00
Leo Horie
acd9d5b641 Merge branch 'bundler-fix' into rewrite
Conflicts:
	api/mount.js
	api/router.js
	api/tests/test-router.js
	index.js
2016-05-20 22:45:51 -04:00
Leo Horie
e5391a1957 bundler variable disambiguation 2016-05-20 22:38:10 -04:00
Pat Cavit
71c77ba603 Add m.redraw() support for multiple mount points
To better match `0.2.x` behavior: https://jsfiddle.net/xbpyqL9k/
2016-05-20 15:27:17 -07:00
Leo Horie
977239d207 rename limiter to throttle and refactor
- don't inject raf/setTimeout since we can't really mock them w/ a good degree of timing accuracy anyways

fix some unrelated tests
2016-05-19 23:24:04 -04:00
Pat Cavit
8f7cc0cb11 Stricter 2016-05-19 10:59:41 -07:00
Pat Cavit
960812308c Move public APIs into their own folder
And start writing actual tests for them
2016-05-19 10:59:41 -07:00
Renamed from mount.js (Browse further)